Results 1 to 2 of 2

Changing set range to a variable range in macros

Threaded View

  1. #1
    Registered User
    Join Date
    03-11-2013
    Location
    Pittsfield, MA
    MS-Off Ver
    Excel 2003
    Posts
    1

    Changing set range to a variable range in macros

    I recorded a macro in which I selected a range to paste values. The issue is that I need the macro to paste the values in a different column depending on a given set of criteria.
    The criteria is as follows:[INDENT]For each set of data I have created a cell that tells me the desired location (row # and column letter) of the values[INDENT]I need the macro to look at those cells and from them know where to paste the values I selected.

    Here is my current macro:
    Dim x As Range
        x = ("D2")
        Dim y As Range
        y = ("C2")
        Range("D4:D21").Select
        Selection.Copy
        Windows("11053 - Item Summary.xlsm").Activate
        Range("x,y").Select
        Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
            :=False, Transpose:=False
    End Sub
    I feel like I am close but have been unable to run the macro without errors. Any help would be greatly appreciated.
    Last edited by arlu1201; 03-14-2013 at 02:39 PM. Reason: Use code tags in future.

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