Results 1 to 3 of 3

Thread: Macro - Jump To Today On Worksheet

  1. #1

    Thread Starter
    New Member
    Join Date
    Mar 2007
    Posts
    0

    Macro - Jump To Today On Worksheet

    im trying find a simple macro or vba code that when ran it will jump to todays date on the excel worksheet. something basic w/

    Code:
    Sub Today_Find() 
         
        <find todays date!> 
         
    End Sub
    i need to be able to search within formulas, as all the dates in all the workbooks are set up like this, the the layout is not in a single column:

    Each cell
    1/1/07
    =above cell+1
    =above cell+1
    =above cell+1
    =above cell+1
    =above cell+1
    =above cell+1...

    I tryied this

    Code:
    Sub FindDate() 
        Dim c As Range 
         
        Set c = ActiveSheet.Cells.Find(what:=Date, LookIn:=xlValues) 
        If Not c Is Nothing Then c.Select 
         
    End Sub
    but it only is picking up a typed in date. for example if today was 1/1/07 and the macro was ran it would find it, but for all the other days they contain a formula which is not being found when macro is run.

  2. #2
    Addicted Member
    Join Date
    Jan 2007
    Location
    England
    Posts
    234

    Re: Macro - Jump To Today On Worksheet

    just recorded this an it works

    Cells.Find(What:=Date, After:=ActiveCell, LookIn:=xlValues, _
    LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, _
    MatchCase:=False, SearchFormat:=False).Activate

  3. #3
    Addicted Member
    Join Date
    Jan 2007
    Location
    England
    Posts
    234

    Re: Macro - Jump To Today On Worksheet

    its to do with the formatting of the cells too!

    Cells.Find(What:=Format(Date, "d/m/yy"), After:=ActiveCell, LookIn:=xlValues, LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, _
    MatchCase:=False, SearchFormat:=False).Activate

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width