Home |
Search |
Today's Posts |
#1
![]() |
|||
|
|||
![]()
Sub Macro1()
' ' Macro1 Macro ' Macro recorded 3/16/2005 by jim ' ' Range("B9").Select Selection.Cut Range("F8").Select ActiveSheet.Paste Range("F10").Select End Sub Hello How do I get this macro to start where it stops? I want it to cut cell B9 then paste it to cell F8 then move to cell F10, this works over & over. I need this macro to cut a cell then move up one row & to the right 4 columns and paste then move back to where it started then move down 2 rows. Thank You |
#2
![]() |
|||
|
|||
![]()
Both below require NO selections
something like for each c in range("b9:b" & cells(rows.count,"b").end(xlup).row) c.copy c.offset(-1,4) next or for every other row this might work for i= 1 to cells(rows.count,"a").end(xlup).row step 2 cells(i,"a").copy cells(i-1,"f") next i -- Don Guillett SalesAid Software "Jim" wrote in message ... Sub Macro1() ' ' Macro1 Macro ' Macro recorded 3/16/2005 by jim ' ' Range("B9").Select Selection.Cut Range("F8").Select ActiveSheet.Paste Range("F10").Select End Sub Hello How do I get this macro to start where it stops? I want it to cut cell B9 then paste it to cell F8 then move to cell F10, this works over & over. I need this macro to cut a cell then move up one row & to the right 4 columns and paste then move back to where it started then move down 2 rows. Thank You |
#3
![]() |
|||
|
|||
![]()
Jim
Try recording the macro with the "Relatiuve Reference" button enabled. You will get different code like this. Sub Macro1() ' ' Macro1 Macro ' Macro recorded 3/16/2005 by Gord Dibben ' ' ActiveCell.Offset(3, 3).Range("A1").Select Selection.Cut ActiveCell.Offset(0, 3).Range("A1").Select ActiveSheet.Paste End Sub Note: you don't have to select things to work on them. Range(Range("A1"), Range("A1").End(xlDown)).Select Selection.Copy Sheets("Sheet2").Select Range("A1").Select Selection.Paste is equal to..... Range(Range("A1"), Range("A1").End(xlDown)).Copy _ Destination:=Sheets("Sheet2").Range("A1") Gord Dibben Excel MVP On Wed, 16 Mar 2005 10:14:46 -0700, "Jim" wrote: Sub Macro1() ' ' Macro1 Macro ' Macro recorded 3/16/2005 by jim ' ' Range("B9").Select Selection.Cut Range("F8").Select ActiveSheet.Paste Range("F10").Select End Sub Hello How do I get this macro to start where it stops? I want it to cut cell B9 then paste it to cell F8 then move to cell F10, this works over & over. I need this macro to cut a cell then move up one row & to the right 4 columns and paste then move back to where it started then move down 2 rows. Thank You |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Problem seting-up Regression Macro | Excel Discussion (Misc queries) | |||
Circular Problem needs Macro | Excel Discussion (Misc queries) | |||
Problem executing a macro from different workbook where it is | Excel Discussion (Misc queries) | |||
URGENT Mac/PC macro compatibility problem | Excel Discussion (Misc queries) | |||
Macro Problem | Excel Discussion (Misc queries) |