+ Reply to Thread
Results 1 to 5 of 5

Execute Find for Today in VBA

Hybrid View

  1. #1
    Registered User
    Join Date
    11-18-2013
    Location
    Poland
    MS-Off Ver
    Excel 2007
    Posts
    31

    Execute Find for Today in VBA

    Hey Geeks,

    I am facing some difficulty.
    I have got 2 columns (well, that's all needed for this coding).

    Column B - date (daily, from 01 Jan to 31 Dec)
    Column C - actual time

    I want my macro to go to todays date, move to actual time column and input actual time (copy afterwards as value)

    so I started coding with:

            Columns("B:B").Select
        Selection.Find(What:=Today, After:=ActiveCell, LookIn:=xlFormulas _
            , LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, _
            MatchCase:=False, SearchFormat:=False).Activate
    Selection.ActiveCell.Offset(0,1).Select
    ActiveCell.FormulaR1c1 = "=now()-today()"
    Selection.Copy
    Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
    :=False, Transpose:=False
    I seem to be just missing, how to look for today in Find.

    Anyone can help?
    Much appreciated
    Last edited by VitoBdG; 05-20-2014 at 05:05 AM.

  2. #2
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    15,636

    Re: Execute Find for Today in VBA

    Your post does not comply with Rule 3 of our Forum RULES. Use code tags around code.

    Posting code between [CODE] [/CODE] tags makes your code much easier to read and copy for testing, it also maintains VBA formatting.

    Highlight your code and click the # icon at the top of your post window. More information about these and other tags can be found here



    (This thread should receive no further responses until this moderation request is fulfilled, as per Forum Rule 7)

  3. #3
    Registered User
    Join Date
    11-18-2013
    Location
    Poland
    MS-Off Ver
    Excel 2007
    Posts
    31

    Re: Execute Find for Today in VBA

    I believe to have updated the formatting as requested

  4. #4
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    15,636

    Re: Execute Find for Today in VBA

    Use Date instead of Today

  5. #5
    Registered User
    Join Date
    11-18-2013
    Location
    Poland
    MS-Off Ver
    Excel 2007
    Posts
    31

    Re: Execute Find for Today in VBA

    Works!

    Thank you very much

+ 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. Find today's date and then add 1
    By brown3218 in forum Excel Programming / VBA / Macros
    Replies: 13
    Last Post: 06-17-2013, 01:21 AM
  2. Find today's date
    By Lynneth in forum Excel General
    Replies: 1
    Last Post: 01-05-2012, 08:25 AM
  3. Using a sheet with a list to find and execute certain macros
    By crowdx42 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-29-2006, 05:09 AM
  4. my excel formulas are too long to execute find and replace
    By jmh33 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 02-22-2006, 01:40 PM
  5. FileSearch.Execute does not find *.eml or *.lnk files
    By RosH in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 12-08-2005, 04:25 AM

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