+ Reply to Thread
Results 1 to 7 of 7

Select cell that contains todays date

Hybrid View

  1. #1
    Registered User
    Join Date
    01-03-2012
    Location
    Australia
    MS-Off Ver
    Excel 2003
    Posts
    18

    Exclamation Select cell that contains todays date

    I have a quick VBA problem i need solved asap.

    I simply need to set up a macro which selects a cell that equals todays date in row 1.

    Simple as that.

    I have barely any VBA experience so any help would be greatly appreciated.

    After i've got this sorted out i have a few other things but they can wait for the moment.

    HELP!
    Last edited by JBeaucaire; 08-16-2012 at 11:52 PM. Reason: Corrected thread title to topic only, as per forum rules

  2. #2
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,653

    Re: URGENT! Select cell that contains todays date

    Sub Select_Today()
        Dim rng As Range
        Set rng = Range("1:1").Find(Date, , xlValues, xlWhole)
        If Not rng Is Nothing Then
            rng.Select
        Else
            MsgBox "Cannot locate today's date in row 1.", , "Today Never Happened"
        End If
    End Sub

  3. #3
    Registered User
    Join Date
    03-24-2012
    Location
    Toledo, Oh
    MS-Off Ver
    Excel 2003
    Posts
    24

    Re: URGENT! Select cell that contains todays date

    May I jump in here Cutter and say that I would like to insert your code into my macro to replace the hard selection that I have in mine with yours. Not sure why, but my attempts have not been successful. Thank you.

    Sub ClearOrder()
    '
    ' Macro6 Macro
    ' Macro recorded 5/11/2012 by Koala Berry
    '
    
    '
        Range("BR4").Select
        ActiveWindow.ScrollColumn = 28
        ActiveWindow.ScrollColumn = 27
        ActiveWindow.ScrollColumn = 26
        ActiveWindow.ScrollColumn = 25
        ActiveWindow.ScrollColumn = 24
        ActiveWindow.ScrollColumn = 23
        ActiveWindow.ScrollColumn = 22
        ActiveWindow.ScrollColumn = 21
        ActiveWindow.ScrollColumn = 20
        ActiveWindow.ScrollColumn = 19
        ActiveWindow.ScrollColumn = 18
        ActiveWindow.ScrollColumn = 17
        ActiveWindow.ScrollColumn = 16
        ActiveWindow.ScrollColumn = 15
        ActiveWindow.ScrollColumn = 14
        ActiveWindow.ScrollColumn = 13
        ActiveWindow.ScrollColumn = 12
        ActiveWindow.ScrollColumn = 11
        ActiveWindow.ScrollColumn = 10
        ActiveWindow.ScrollColumn = 9
        ActiveWindow.ScrollColumn = 8
        ActiveWindow.ScrollColumn = 7
        ActiveWindow.ScrollColumn = 6
        ActiveWindow.ScrollColumn = 5
        ActiveWindow.ScrollColumn = 4
        ActiveWindow.ScrollColumn = 3
        ActiveWindow.ScrollColumn = 2
        Range("B4:CA4").Select
        Selection.ClearContents
        Range("a526").Select
    
    End Sub
    Last edited by Cutter; 09-18-2012 at 05:17 PM. Reason: Added code tags

  4. #4
    Registered User
    Join Date
    01-03-2012
    Location
    Australia
    MS-Off Ver
    Excel 2003
    Posts
    18

    Re: Select cell that contains todays date

    you are a legend! thanks for the quick reply!
    I have a few other things i need to get figured out but i'll ask that later on.

    Thanks again!

  5. #5
    Forum Expert Cutter's Avatar
    Join Date
    05-24-2004
    Location
    Ontario,Canada
    MS-Off Ver
    Excel 2010
    Posts
    6,451

    Re: Select cell that contains todays date

    @ burnsy180

    Based on your last post it seems that you are satisfied with the solution(s) you've received but you haven't marked your thread as SOLVED. I'll do that for you now but please keep in mind for your future threads that Rule #9 requires you to do that yourself. If your problem has not been solved you can use Thread Tools (located above your first post) and choose "Mark this thread as unsolved".
    Thanks.

    Also, as a relatively new member of the forum, you may not be aware that you can thank those who have helped you by clicking the small star icon located in the lower left corner of the post in which the help was given. By doing so you can add to the reputation(s) of those who helped.

  6. #6
    Forum Expert Cutter's Avatar
    Join Date
    05-24-2004
    Location
    Ontario,Canada
    MS-Off Ver
    Excel 2010
    Posts
    6,451

    Re: Select cell that contains todays date

    Hello kennected.

    Unfortunately you have inadvertently broken two of the forum rules. Please read the following and make the necessary change. Thanks.

    Your post does not comply with Rule 2 of our Forum RULES. Don't post a question in the thread of another member -- start your own thread. If you feel it's particularly relevant, provide a link to the other thread. It makes sense to have a new thread for your question because a thread with numerous replies can be off putting & difficult to pick out relevant replies.

    Your post does not comply with Rule 3 of our Forum RULES. Use code tags around code. Posting code without them makes your code hard to read and difficult to be copied for testing. Highlight your code and click the # at the top of your post window. For more information about these and other tags, found here

  7. #7
    Registered User
    Join Date
    03-24-2012
    Location
    Toledo, Oh
    MS-Off Ver
    Excel 2003
    Posts
    24

    Re: Select cell that contains todays date

    Thanks Cutter, I have reviewed the rules and hope my re-post is now compliant. 2 in one post, yikes!
    Ken

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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