View Single Post
  #8   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Dave Dave is offline
external usenet poster
 
Posts: 1,388
Default Macro to move one cell down

Hi tjb,
You can use the Cells property.
So your code will look like this:

Windows("Extract.xls").Activate
Static A As Integer
If A = 0 Then A = 4
Cells(A, 1).Select
A = A + 1
Selection.Copy
Windows("PascoTOC.xls").Activate
Range("E8").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks _
:=False, Transpose:=False

Each time the macro is run, the variable 'A' is incremented, so the Cells(A,
1) will refer to the next cell in the column. (The Cells property uses R1C1
notation).
Declaring 'A' as Static, means that its value will be retained for as long
as the workbook is open. If you close the workbook, the macro will start at
A4 again.
Hope this is what you're after.
Dave.