my opening stopped working

still learning

Well-known Member
Joined
Jan 15, 2010
Messages
821
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

Will the fill handle fill 1, 2, 3?
Yes! Type 1 in a cell. Hold down Ctrl while you drag the fill handle.
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,223,886
Messages
6,175,196
Members
452,616
Latest member
intern444

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