E
EE
Hi all
I have a database of about 10 rows and 5000 columns (Starting from
A5).
I created a cell (D2) in the file where I enter a number (say 100) and
gave it a name (NumOfRows).
I have created Dynamic Named RAnges (for CHARTING) in such a way that
from a reference cell (Say G5), it will look for the number in
"NumOfRows" and select as many rows in that column for the graph.
Now I have a need to PASTE the same data in another sheet. I assume
that for this I need to select an exact sized range to paste the named
range (correct me if I am wrong)
I am using the following code but it does not work. Where am I going
wrong?
Thanks in advance for your help.
Best
Prasad
**********************
Sub Test()
Worksheets("Data").Select
Range("J4").Select
ActiveCell.FormulaR1C1 = "X Range"
Range("J4").Select
'NumOfRows is my NAmed RAnges for the cell called
ActiveCell.Offset(1, 0).Resize(Range("NumOfRows").Value, 0).Select
Selection.Value = Worksheets("SampleData1").Range("XRange").Value
End Sub
*********************************
I have a database of about 10 rows and 5000 columns (Starting from
A5).
I created a cell (D2) in the file where I enter a number (say 100) and
gave it a name (NumOfRows).
I have created Dynamic Named RAnges (for CHARTING) in such a way that
from a reference cell (Say G5), it will look for the number in
"NumOfRows" and select as many rows in that column for the graph.
Now I have a need to PASTE the same data in another sheet. I assume
that for this I need to select an exact sized range to paste the named
range (correct me if I am wrong)
I am using the following code but it does not work. Where am I going
wrong?
Thanks in advance for your help.
Best
Prasad
**********************
Sub Test()
Worksheets("Data").Select
Range("J4").Select
ActiveCell.FormulaR1C1 = "X Range"
Range("J4").Select
'NumOfRows is my NAmed RAnges for the cell called
ActiveCell.Offset(1, 0).Resize(Range("NumOfRows").Value, 0).Select
Selection.Value = Worksheets("SampleData1").Range("XRange").Value
End Sub
*********************************