+ Reply to Thread
Results 1 to 6 of 6

"button" to move curser to a specific cell based upon formula results in another cell

Hybrid View

  1. #1
    Registered User
    Join Date
    01-06-2013
    Location
    Sacramento,CA
    MS-Off Ver
    2013
    Posts
    36

    "button" to move curser to a specific cell based upon formula results in another cell

    A1 has the function =Today() in it

    The range (or row) D2:QU2 contains days for the next year

    I would like to have a "button" in cell A2 that when pressed, will take the curser to today's date in the range specified.

    Kind of like a hyper-link

  2. #2
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2406 Win 11 Home 64 Bit
    Posts
    23,958

    Re: "button" to move curser to a specific cell based upon formula results in another cell

    try this:

    Sub find_date()
        Dim d As Date, i As Long
        d = Date
        Dim lc As Long
        lc = Cells(1, Columns.Count).End(xlToLeft).Column
            
            For i = 4 To lc
            If Cells(1, i).Value = d Then
            Cells(1, i).Select
            Exit Sub
            End If
            Next
    End Sub
    Alan עַם יִשְׂרָאֵל חַי


    Change an Ugly Report with Power Query
    Database Normalization
    Complete Guide to Power Query
    Man's Mind Stretched to New Dimensions Never Returns to Its Original Form

  3. #3
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: "button" to move curser to a specific cell based upon formula results in another cell

    you could actually use a hyper link

    =HYPERLINK("#"&ADDRESS(2,MATCH(A2,D2:QU2,0)+3),"jump to today")
    "Unless otherwise stated all my comments are directed at OP"

    Mojito connoisseur and now happily retired
    where does code go ?
    look here
    how to insert code

    how to enter array formula

    why use -- in sumproduct
    recommended reading
    wiki Mojito

    how to say no convincingly

    most important thing you need
    Martin Wilson: SPV
    and RSMBC

  4. #4
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2406 Win 11 Home 64 Bit
    Posts
    23,958

    Re: "button" to move curser to a specific cell based upon formula results in another cell

    @Martin--very nice.

  5. #5
    Registered User
    Join Date
    01-06-2013
    Location
    Sacramento,CA
    MS-Off Ver
    2013
    Posts
    36

    Re: "button" to move curser to a specific cell based upon formula results in another cell

    Thanks to all of you. I went with the hyperlink and it is exactly what I want. Thanks again, all

  6. #6
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2406 Win 11 Home 64 Bit
    Posts
    23,958

    Re: "button" to move curser to a specific cell based upon formula results in another cell

    Thanks for the rep.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] If there is any text in column "A$" on "sheet1" then move cell to column "A$" on "sheet2"
    By ckgeary in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 06-27-2013, 08:28 PM
  2. VBA Code- Move/Split cell content based on ","
    By Langer101 in forum Excel Programming / VBA / Macros
    Replies: 17
    Last Post: 12-19-2012, 11:37 AM
  3. Change "Parent" cell based on results of multiple "Children" cells
    By ccowman in forum Excel Formulas & Functions
    Replies: 16
    Last Post: 12-14-2012, 02:33 AM
  4. Replies: 1
    Last Post: 05-30-2006, 04:10 PM
  5. Formula in "Cell Link" box of Option Button?
    By Zzed in forum Excel General
    Replies: 2
    Last Post: 07-14-2005, 04:05 PM

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1