Hi,I'm having some problem figuring out why the following code is not working. When I open my file, I want a macro to automatically hide columns G -Z if they were unhidden when the file was last saved. And I want the active cell to be the next open cell (or blank cell) in Column B (starting with B4). My range in column B where data will go is B4:B1003
What keeps happening is, it hides the Columns as expected, but the active cell goes to B1005. Why?
Help would definitely be appreciated
HTML:
Private Sub Workbook_Open()
'This Hides Columns G-Z when file is opened
'This code opens Excel to W_Log sheet and to the next record in column B
Worksheets("W_Log").Select
Sheets("W_Log").Columns("G:Z").Hidden = True
Dim iRow As Long
iRow = Cells(Rows.Count, "b").End(xlUp).Row - 5
If iRow < 1 Then iRow = 1
ActiveWindow.ScrollRow = iRow
Cells(Rows.Count, "B").End(xlUp).Offset(1).Select
End Sub
What keeps happening is, it hides the Columns as expected, but the active cell goes to B1005. Why?
Help would definitely be appreciated