can't get find date macro to work

still learning

Well-known Member
Joined
Jan 15, 2010
Messages
826
Office Version
  1. 365
Platform
  1. Windows
Hi

I’m can’t get this macro to work.
I make a new worksheet
I put in today's date with format m/dd/yyyy in A7
The rest of the sheet is blank
I put this macro in sheet1 of the VBA window
VBA Code:
Private Sub Worksheet_activate()
Cells.Find(Date).Select
Set C = [A:A].Find(Format(Date, "m/dd/yyyy"))
If Not C Is Nothing Then C.Select
ActiveWindow.ScrollRow = ActiveCell.Row
ActiveWindow.SmallScroll Down:=-1
End Sub
I save and close the sheet
(yes I made it an macro enabled workbook)
When I open it, the cursor goes to A1
That’s where it was when I saved and closed it
I tried changing Worksheet_activate to Worksheet_open
Nothing is in This workbook
I’m using File open and clicking on the sheet


mike
 

Excel Facts

Did you know Excel offers Filter by Selection?
Add the AutoFilter icon to the Quick Access Toolbar. Select a cell containing Apple, click AutoFilter, and you will get all rows with Apple
You are welcome.
Glad we were able to get it all sorted out.
 
Upvote 0

Forum statistics

Threads
1,224,811
Messages
6,181,081
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