View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
JLatham JLatham is offline
external usenet poster
 
Posts: 3,365
Default Newbie -& I am not getting this

Change that to
Sheets("Extract").Range("A1:" & Endrange).Copy

You need to to concatenate the calculated address Endrange with the first
part instead of trying to do it the way you did. Excel is taking Endrange as
a literal the way you have it and has no clue as to what you are talking
about.

"BruceG" wrote:

I am getting a run error 1004 on the last line - what am I not getting?

What I want to do is go to Point "Alpha" count all the rows including but
backing out 1 for the total line then go to Sheet Extract and copy a line of
formulas (defined as range "Formula") down the sheet count number that was
just counted and adjusted by 1. USing a Click button to perform this
operation.

Any help would be greatly apprecioated.

BruceG

Private Sub CommandButton1_Click()

Dim i As Integer
Dim j as Integer

Application.Goto Reference:="Alpha"
Sheets("Setup").Range("g3").Select
i = Selection.End(xlDown).Count

j = i - 1

Endrange = "A" & j
Sheets("Extract").Range("A1:Endrange").Copy Error Line

End Sub