Hallo,
I need some help.
Copy some data from one sheet to another sheet, but the number of rows is not always the same. How do they automatically hide rows below the last line data.
Hallo,
I need some help.
Copy some data from one sheet to another sheet, but the number of rows is not always the same. How do they automatically hide rows below the last line data.
Re: Automatically hide from LastRow to the end of rows
Thanks cytop,
Somehow not working. Gonna tests.
Re: Automatically hide from LastRow to the end of rows
My sample does work, tested to make sure. If you have changed to refer to another worksheet, can you post your changes?
All supposing I understand correctly. You want to 'hide' unused rows/columns? While that does not hide them as such, it prevents the user scrolling to them.
Re: Automatically hide from LastRow to the end of rows
Yes cytop, it works but not the way I want. It prevents the user scrolling to them and I want to hide rows if possible.
Thanks.
Re: Automatically hide from LastRow to the end of rows
OK - so I tested that using a sheet with quite a few rows/columns... it doesn't let the cursor move past the used range so extra columns and rows were effectively invisible. However, if there's only a few rows/columns, some are left visible.
Alternative.
Sub HideUnused()
Dim lngCol As Long
Dim lngrow As Long
lngCol = Cells(1, Columns.Count).End(xlToLeft).Column
lngrow = Cells(Rows.Count, "A").End(xlUp).Row
Range(Cells(1, lngCol + 1), Cells(Rows.Count, Columns.Count)).EntireColumn.Hidden = True
Range(Cells(lngrow + 1, 1), Cells(Rows.Count, Columns.Count)).EntireRow.Hidden = True
End Sub
Display More
Re: Automatically hide from LastRow to the end of rows
Yes this is it. Thank you very much cytop.
Don’t have an account yet? Register yourself now and be a part of our community!