View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
ste mac ste mac is offline
external usenet poster
 
Posts: 117
Default Simple scroll and select?

Hi, can anybody help please... I am trying to make the code below pick
up the range of data.. 'A1 down to the last value on each sheet', 2
thru 56
and paste it in the sheet "S1"...but I cannot get the scroll bit
right...

thanks

ste

Sub cdata()
Dim StartCell, EndCell As Range

Application.ScreenUpdating = False
For sheetNumber = 2 To 56

SheetName = "S" & Format(sheetNumber, "##0")
Sheets(SheetName).Select

Set StartCell = ActiveSheet.Range("A1")

Application.Goto reference:=ActiveSheet.Cells(ActiveSheet.Range
_("A1").Value + 1, "A"), Scroll:=False
'struggling with this bit

Set EndCell = ActiveCell
Range(StartCell, EndCell).Select
Selection.Cut
Sheets("S1").Range("A65536").End(xlUp).PasteSpecia l
Paste:=xlPasteValues
Next
End Sub