View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Finny[_3_] Finny[_3_] is offline
external usenet poster
 
Posts: 49
Default Syntax Help: Range variables (plucking data and pasting to 2nd sheet)

I think the code is straightforward in its intent.
I just want to pluck a cell value from sheet 1 to sheet 2
Then a range to sheet 2
then another range to sheet 2
How can this be done?
Thanks in advance.

Dim srcRowNum As Integer
Dim dstRowNum As Integer
srcRowNum = 19
dstRowNum = 2
Do Until rownum 600
'ITEM CODE
Range(Cells(srcRowNum + 1, 1)).Copy
Worksheets(1).Range(Cells(srcRowNum + 1, 1)).Copy
Worksheets(2).Range(Cells(dstRowNum, 1)).Paste
'WEEKLY
Worksheets(1).Range(Cells(srcRowNum, 4), Cells(srcRowNum,
16)).Copy
Worksheets(2).Range(Cells(dstRowNum, 2)).Paste
srcRowNum = srcRowNum + 6
'MONTHLY
Worksheets(1).Range(Cells(srcRowNum, 4), Cells(srcRowNum,
16)).Copy
Worksheets(2).Range(Cells(dstRowNum, 17)).Paste
srcRowNum = srcRowNum + 8
dstRowNum = dstRowNum + 1
Loop