still learning
Well-known Member
- Joined
- Jan 15, 2010
- Messages
- 826
- Office Version
- 365
- Platform
- Windows
Hi,
I’m trying to add code to have the cursor go to today’s date. The problem is that I have it in two places. One in a un- hidden column and one in a hidden column. On opening the sheet, the cursor tries to find the closest one to AI, even if’s it a hidden column. I want it to go to the un-hidden one on opening the sheet and only go to the hidden one when I un-hide the columns.
I ranged name the un-hidden column “weekly” and the hidden column with the dates “daily”
I added the line in red to the following codes:
And:
But I can’t get to work.
Without the new lines, on opening , I have to move to the right date.
<?xml:namespace prefix = o ns = "urn:schemas-microsoft-comfficeffice" /><o></o>
<o></o>
<o></o>
Mike
I’m trying to add code to have the cursor go to today’s date. The problem is that I have it in two places. One in a un- hidden column and one in a hidden column. On opening the sheet, the cursor tries to find the closest one to AI, even if’s it a hidden column. I want it to go to the un-hidden one on opening the sheet and only go to the hidden one when I un-hide the columns.
I ranged name the un-hidden column “weekly” and the hidden column with the dates “daily”
I added the line in red to the following codes:
HTML:
Private Sub workbook_open()
Application.Goto Reference:="R5C1"
ActiveWindow.FreezePanes = True
Application.Goto Reference:="weekly"
gotodateday
End Sub
HTML:
Sub unhide()
ActiveWindow.FreezePanes = False
Application.Goto Reference:="R5C1"
ActiveWindow.FreezePanes = True
Application.Goto Reference:="R600C100"
Application.Goto Reference:="days"
Application.ScreenUpdating = False
Range("A1").Select
Range("weight").Select
Selection.EntireColumn.Hidden = False
Application.Goto Reference:="daily"
gotodateday
ActiveCell.Offset(0, 1).Range("A1").Select
Application.ScreenUpdating = True
ActiveWindow.ScrollRow = ActiveCell.Row - 1
End Sub
Without the new lines, on opening , I have to move to the right date.
<?xml:namespace prefix = o ns = "urn:schemas-microsoft-comfficeffice" /><o></o>
<o></o>
<o></o>
Mike