View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
JohnUK JohnUK is offline
external usenet poster
 
Posts: 173
Default Everchanging number of rows

Hi,
Where am I going wrong on this piece of code below
What I am trying to achieve in simple terms is this:
Range("A2").Select
ActiveCell.FormulaR1C1 = "1"
Selection.Copy
Range("A2:A10000").Select
ActiveSheet.Paste

But I need it to size with the amount of rows the rest of the data uses
My try:
Range("A2").Select
ActiveCell.FormulaR1C1 = "1"
Selection.Copy
Range("A2:A & Range("Count")").Select
ActiveSheet.Paste

I have already created a Range called €˜Count that adds up the rows. For
example, if my data spans 100 rows, I want the formula to also reach 100 rows.
I know this may not make any sense, because I could use formulas etc, but is
the above possible
Many thanks