Franknu
01-08-2023, 09:02 PM
Hi,
I am using the below code to scroll to the top of the row(A1). But i have to run the macro in every worksheet of the workbook.
How do I alter it to run across all the worksheet of the workbook ao i don't have to run it for every worksheet.
Public Sub AllSheetNames()
Dim wrk As Workbook
Dim sht As Worksheet
For Each wrk In Workbooks
For Each sht In wrk.Worksheets
ActiveWindow.ScrollRow = 1
Next sht
Next wrk
End Sub
I am using the below code to scroll to the top of the row(A1). But i have to run the macro in every worksheet of the workbook.
How do I alter it to run across all the worksheet of the workbook ao i don't have to run it for every worksheet.
Public Sub AllSheetNames()
Dim wrk As Workbook
Dim sht As Worksheet
For Each wrk In Workbooks
For Each sht In wrk.Worksheets
ActiveWindow.ScrollRow = 1
Next sht
Next wrk
End Sub