+ Reply to Thread
Results 1 to 2 of 2

Find and Replace (with changing date) in macro

Hybrid View

  1. #1
    Registered User
    Join Date
    09-30-2011
    Location
    Los Angeles, California
    MS-Off Ver
    Excel 2003
    Posts
    1

    Find and Replace (with changing date) in macro

    I am trying to automate a report update that requires a find a replace in the middle of the process and need it to use an updated date everyday. I tried to get it to record my copy/paste of the date cell to use in the find&replace...no luck. Also, tried to set the date cell as an active cell...no luck.

    It just wants to hard code in the original dates I pasted into the Find&replace window. This is how it currently set up...

    Selection.Replace What:="2011-0929", Replacement:="2011-0930", LookAt:= _
            xlPart, SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
            ReplaceFormat:=False
    Thank you
    Last edited by mattrp; 09-30-2011 at 03:33 PM. Reason: add code tags

  2. #2
    Forum Expert Mordred's Avatar
    Join Date
    07-06-2010
    Location
    Winnipeg, Canada
    MS-Off Ver
    2007, 2010
    Posts
    2,787

    Re: Find and Replace (with changing date) in macro

    Hello mattrp and welcome to the forum.

    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
    If you're happy with someone's help, click that little star at the bottom left of their post to give them Reps.

    ---Keep on Coding in the Free World---

+ 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