my opening stopped working

still learning

Well-known Member
Joined
Jan 15, 2010
Messages
826
Office Version
  1. 365
Platform
  1. Windows
Hi
the macro that i've been using for awhile stopped working
I can use F8 and it works fine
I have it in "This Workbook" as
VBA Code:
Private Sub Workbook_Open()
Sheets("upcoming").Select
  With Sheets("upcoming").Range("A1")  
opening
End Sub
and in "Sheets("upcoming")". as
VBA Code:
Private Sub Worksheet_activate()
Sheets("upcoming").Select
  With Sheets("upcoming").Range("A1")  
opening
End Sub
it puts the cursor on the correct date BUT will not scroll
I think it stopped scrolling on May first
Wonder if it has to do with the fact that there is a column called "MAY"
This macro is in a module
VBA Code:
Sub opening()
   ' for upcoming
Set C = Range("A:A").Find(Date)
   If Not C Is Nothing Then C.Select
 ActiveWindow.ScrollRow = ActiveCell.Row
ActiveWindow.SmallScroll 'Down:=-1
End Sub


mike
 

Excel Facts

Fastest way to copy a worksheet?
Hold down the Ctrl key while dragging tab for Sheet1 to the right. Excel will make a copy of the worksheet.
These two bits of code that you posted:
VBA Code:
Private Sub Workbook_Open()
Sheets("upcoming").Select
  With Sheets("upcoming").Range("A1")  
opening
End Sub
VBA Code:
Private Sub Worksheet_activate()
Sheets("upcoming").Select
  With Sheets("upcoming").Range("A1")  
opening
End Sub

Will not compile because the End With statement is missing. That might be a place to start.
 
Upvote 0
Option Explicit - This is our everything!
ThisWorkbook module:
VBA Code:
Option Explicit

Private Sub Workbook_Open()
    Application.Goto ThisWorkbook.Worksheets("upcoming").Range("A1")
End Sub
upcoming Sheet Module:
Code:
Option Explicit

Private Sub Worksheet_Activate()

    '  Your macro "opening" in short version
    Dim C As Range: Set C = Me.Range("A:A").Find(Date)
    If Not C Is Nothing Then Application.Goto C, True
End Sub
Good luck.
 
Last edited:
Upvote 0

Forum statistics

Threads
1,224,813
Messages
6,181,112
Members
453,021
Latest member
Justyna P

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top