ashish koul
Member
If you want to select the first cell after freeze pane on each worksheet and save it. So that when user opens the workbook he/she do not have to press CTRL+ Home in each worksheet to go to first cell.
Here is the code -
[pre]
[/pre]
Here is the code -
[pre]
Code:
Sub goto_first_cell_in_each_worksheet()
Dim wk As Worksheet
For Each wk In ThisWorkbook.Sheets
wk.Select
If ActiveWindow.SplitRow = 0 And ActiveWindow.SplitColumn = 0 Then
Application.Goto Range("a1")
Exit Sub
Else
Application.Goto Range(Cells(ActiveWindow.SplitRow + 1, ActiveWindow.SplitColumn + 1).Address)
End If
Next
ActiveWorkbook.Save
End Sub