create a macro/button that will go to today's date cell

mistrall22

New Member
Joined
Jun 17, 2011
Messages
2
Hi,<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /><o:p></o:p>
<o:p></o:p>
I have an excel worksheet with a one year calendar all in one worksheet.<o:p></o:p>
<o:p></o:p>
I would like create a macro that will bring me to Today’s cell wherever I am in the worksheet.<o:p></o:p>
<o:p></o:p>
tks for your help :cool:<o:p></o:p>
<o:p></o:p>
Jay<o:p></o:p>
 
This macro isn't working for me, possibly because my dates are determined by a formula. In my sheet, the user defines a start date and an end date for a project. The date row then populates off these dates.

Is there a way to modify this macro to look at the cell value rather than the formula? Here is the formula that determines the date:

=IFERROR(IF(DATE(YEAR(H$7),MONTH(H$7),DAY(H$7)+1)<=$E$1,(DATE(YEAR(H$7),MONTH(H$7),DAY(H$7)+1))," "),"")

Thank you for the help!

This will find today's date in row 1 based on the dates as displayed in the cell. Change the date format in the code to match the cell formatting of your dates.

Change the Date to any serial date you want to search for.

Code:
[COLOR=darkblue]Sub[/COLOR] Macro1()
    
    Rows(1).Find(Format([COLOR=#0000ff]Date[/COLOR], [COLOR=#ff0000]"dddd, mmmm d, yyyy"[/COLOR]), , xlValues, xlWhole).Select
    
[COLOR=darkblue]End[/COLOR] [COLOR=darkblue]Sub[/COLOR]
 
Upvote 0

Excel Facts

Wildcard in VLOOKUP
Use =VLOOKUP("Apple*" to find apple, Apple, or applesauce
thank you for thread

Similar to the above query.. i too have problem in programming in the Vba excel.

My requirement is
I have a dates of complete year in particular row. I need to insert a calendar to excel and when i select a date in the calendar, excel should be navigated to that particular cell with that date that i had selected in the calendar.

Ex. If i select december 20 in calendar.. the excelshould be navigated to that cell which has 20 december 2017.

Hope u have under understood my query..
Sorry if there is any mistake in the post as this is the first time i'm posting..


Expecting support any of them.. Pls support.
 
Upvote 0
Sub GoToToday()

Rows(4).Find(Format(Date, "ddd dd/mm/yy"), , xlValues, xlWhole).Select

End Sub

Using the above, if I run the macro, I'm getting the following error:

"Run Time Error 91
Object variable or with block variable not set"


My cells are formatted: ddd dd/mm/yy

They are all formulas saying B4+1, C4+1, D4+1 etc etc.

What am I missing please?
 
Upvote 0

Forum statistics

Threads
1,224,603
Messages
6,179,856
Members
452,948
Latest member
UsmanAli786

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