• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Copy & Paste From/To Named Ranges Bases on a cell value

Mat_W

New Member
Hi!

I'm new and my first post.

I need to copy a named range based on the name of the range in a cell then paste value/format to another named range that is named in another cell value.

Code:
    Application.Goto Reference:="aug_cy"
    Application.CutCopyMode = False
    Selection.Copy
    Application.Goto Reference:="test_py"
    Selection.PasteSpecial Paste:=xlPasteValuesAndNumberFormats, Operation:= _
        xlNone, SkipBlanks:=False, Transpose:=False

the cell for the range name aug_cy is t14 and the value for the range test_py is u14

Hope that makes sense?

Many thanks
 
Last edited by a moderator:
Code:
Application.Goto Reference:=Range("T14").Text
    Selection.Copy
    Application.Goto Reference:=Range("U14").Text
    Selection.PasteSpecial Paste:=xlPasteValuesAndNumberFormats, _
             Operation:= xlNone, _
             SkipBlanks:=False, _
             Transpose:=False
 
…and without selecting:
Code:
Range(Range("T14").Text).Copy
Range(Range("U14").Text).PasteSpecial Paste:=xlPasteValuesAndNumberFormats, Operation:=xlNone, SkipBlanks:=False, Transpose:=False
 
Back
Top