Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Cell ref from a named range

Status
Not open for further replies.

mpm32

Technical User
Feb 19, 2004
130
0
0
US
I have a named range. The cell in this range holds the cell reference of the last open cell in a list of data on another sheet. When I try to call that reference from the named range in my code, I get an error.

This works;

Code:
Sheets("Summary").Select
    Range("B3:O3").Select
    Selection.Copy
   
    Sheets("Data").Select
    
    Range("B6").Select
    
    Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
        :=False, Transpose:=False
End Sub

When I try to replace the "B6" with the range name "DataRow" which has the text B6 in it I get an error Run time error select method of range class failed.

Code:
Sheets("Summary").Select
    Range("B3:O3").Select
    Selection.Copy
   
    Sheets("Data").Select
    
    Range("DataRow").Select
    
    Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
        :=False, Transpose:=False
End Sub

How can I use the value in the named range as my cell reference?
 


hi,
Code:
Sheets("Summary").Range("B3:O3").Copy
   
Sheets("Data").Range([DataRow]).PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
        :=False, Transpose:=False


Skip,
[sub]
[glasses]Just traded in my old subtlety...
for a NUANCE![tongue][/sub]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top