Results 1 to 2 of 2

excel macro variable

Threaded View

theresap excel macro variable 07-08-2010, 04:56 PM
royUK Re: new to programing dont... 07-08-2010, 05:25 PM
  1. #1
    Registered User
    Join Date
    07-08-2010
    Location
    Illinois
    MS-Off Ver
    excel 2007 and 2003
    Posts
    11

    excel macro variable

    I am using excel 2007
    The macro goes to each sheet to a specific range and pastes the values instead of the formula before saving the file. Next week we use the same macro and change the range to the next cells, paste the values and then saves.
    Currently I am manually changing the macro to the next range. So below Range("J16:K16").Select, will be changed to Range("J17:K17").Select and the next week changed to Range("J18:K18").Select

    'save sheet2 weekly data
        Sheets("sheet2").Select
        Range("J16:K16").Select
        Selection.Copy
        Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
            :=False, Transpose:=False
        Application.CutCopyMode = False
    The data (J16:K16) is always found in Sheet1!M2. as my reminder of what to change it to.

    What I am hoping is that you know how to change the line Range("J16:K16").Select so it will automatically put in the data from Sheet1!M2 so I do not have to manually adjust the macro before running it each week.

    Thanks for answering my question.
    Last edited by theresap; 07-08-2010 at 05:42 PM. Reason: name change

Thread Information

Users Browsing this Thread

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

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