still learning
Well-known Member
- Joined
- Jan 15, 2010
- Messages
- 821
- Office Version
- 365
- Platform
- Windows
Hi
When the spreadsheet opens
The macro finds the current month in the column (H1:H450) and scrolls it to the top, then freezes the row. It then goes to the current date in the same column
Since I only have 28 rows in view, sometimes the last few days are out of view…I want to keep the screen at 100% zoom
I’m trying to have that cell scroll up if its out of view.
I’m trying to have that cell scroll up to the title (frozen row) and drop down a few
I don’t need it to do it every time, only when the cell that is found is out of view
The macro worked perfect till I added the “ActiceCell.Row > 12 Then ActiveWindow.ScrollRow = ActiveCell.Row – 12” …(I picked 12 as a test case till I get the macro to work)
Then I get an error “object required”
I though the “object” would be the cell with the current day
mike
VBA Code:
Private Sub Worksheet_activate()
Application.Goto Reference:=Range(Format(Date, "mmmm")), Scroll:=True
ActiveCell.Offset(1, 0).Range("A1").Select
ActiveWindow.FreezePanes = True
Dim C As Range
Set C = Range("H1:H450").Find(Date)
If Not C Is Nothing Then C.Select
If ActiceCell.Row < 12 Then ActiveWindow.ScrollRow = ActiveCell.Row – 12
End Sub
The macro finds the current month in the column (H1:H450) and scrolls it to the top, then freezes the row. It then goes to the current date in the same column
Since I only have 28 rows in view, sometimes the last few days are out of view…I want to keep the screen at 100% zoom
I’m trying to have that cell scroll up if its out of view.
I’m trying to have that cell scroll up to the title (frozen row) and drop down a few
I don’t need it to do it every time, only when the cell that is found is out of view
The macro worked perfect till I added the “ActiceCell.Row > 12 Then ActiveWindow.ScrollRow = ActiveCell.Row – 12” …(I picked 12 as a test case till I get the macro to work)
Then I get an error “object required”
I though the “object” would be the cell with the current day
mike