View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
SWT SWT is offline
external usenet poster
 
Posts: 8
Default VBA question concerning variables

I revised it and found that this also worked: I eliminated having to
have a counta function in the sheet:

Sub QB_Format()
'
' QB_Format Macro
' Macro recorded 10/19/2005 by SWT
' Copies rows 4 through 6 and pastes to varying rows
R = WorksheetFunction.CountA(Range("M_Amount"))
S = (R * 3) + 3
sRange = "A7:K" & S
Range("A4:K6").Copy Destination:=Range(sRange)