Hi All you Guru's
Need a little help with something. I am trying to reset the scroll bar back to A! across a multiple sheets. Currently I have this code. I been trying to add the the scroll reset using the ws.scrollrow=1 or ActiveSheet.UsedRange or application.goto Reference:=Range("a1"), scroll:=True but none of these three worked. Also I am not sure where to place them either. Can you help me? Thanks!
Sub Hide_Columns_Via_CoverPage()
' Hides Columns that are not within the Period
Application.ScreenUpdating = True
Dim ws As Variant, Xrow As Long, LCol As Long
For Each ws In Worksheets(Array("Income Statement", "Balance Sheet", "Cash Flow Statement"))
Xrow = 5
LCol = ws.Cells(5, Columns.Count).End(xlToLeft).Column
With ws
For x = 1 To LCol
If ws.Cells(Xrow, x) <> "X" Then
ws.Columns(x).Hidden = True
Else
ws.Columns(x).Hidden = False
End If
Next x
End With
Need a little help with something. I am trying to reset the scroll bar back to A! across a multiple sheets. Currently I have this code. I been trying to add the the scroll reset using the ws.scrollrow=1 or ActiveSheet.UsedRange or application.goto Reference:=Range("a1"), scroll:=True but none of these three worked. Also I am not sure where to place them either. Can you help me? Thanks!
Sub Hide_Columns_Via_CoverPage()
' Hides Columns that are not within the Period
Application.ScreenUpdating = True
Dim ws As Variant, Xrow As Long, LCol As Long
For Each ws In Worksheets(Array("Income Statement", "Balance Sheet", "Cash Flow Statement"))
Xrow = 5
LCol = ws.Cells(5, Columns.Count).End(xlToLeft).Column
With ws
For x = 1 To LCol
If ws.Cells(Xrow, x) <> "X" Then
ws.Columns(x).Hidden = True
Else
ws.Columns(x).Hidden = False
End If
Next x
End With