Harshil Mehta
Board Regular
- Joined
- May 14, 2020
- Messages
- 85
- Office Version
- 2013
- Platform
- Windows
I want to hide Columns from the last used cell in Row NO. 10 till the end column.
VBA Code:
Sub Hide_Column_Rows()
Dim LastRow, LastColumn As Long
LastColumn = Cells("10", Columns.Count).End(xlToLeft).Column
Range(LastColumn + 2 & ":XFD1048576").EntireColumn.Hidden = True
LastRow = Cells(Rows.Count, "B").End(xlUp).Row
Range("B" & LastRow + 2 & ":B1048576").EntireRow.Hidden = True
End Sub