Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
I have a sheet with the following macro, actually this is just part of it. If
I'm correct it cuts rows from sheet 9 Rows("2:11") and pastes them to sheet 1("A7"). it works fine, however I would like to modify it so that it cuts the rows, but skips columns (cells) BX, BY, BZ in each row. These columns (cells) have formulas that become overwritten when the current macro runs. is there a way to make this work? Sheets("Sheet9").Select Rows("2:11").Select Selection.Copy Sheets("Sheet1").Select Range("A7").Select ActiveSheet.Paste Thanks, M.A.Tyler |
#2
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
One way:
With Sheets("Sheet9") .Range("A2:BW11").Copy Destination:=Sheets("Sheet1").Range("A7") .Range("CA2:IV11").Copy Destination:=Sheets("Sheet1").Range("CA7") End With Note that no selection is needed. Working with range objects directly is usually faster and produces more manageable code. In article , M.A.Tyler <Great Lakes State wrote: I have a sheet with the following macro, actually this is just part of it. If I'm correct it cuts rows from sheet 9 Rows("2:11") and pastes them to sheet 1("A7"). it works fine, however I would like to modify it so that it cuts the rows, but skips columns (cells) BX, BY, BZ in each row. These columns (cells) have formulas that become overwritten when the current macro runs. is there a way to make this work? Sheets("Sheet9").Select Rows("2:11").Select Selection.Copy Sheets("Sheet1").Select Range("A7").Select ActiveSheet.Paste Thanks, M.A.Tyler |
#3
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Instead of your second line:
Rows("2:11").Select make this: Range("A2:BW11").Select If you have any data beyond column BZ that you also want to cut/paste, then just repeat the lines you have but with the range CA2:IV11, and instead of Range("A7").Select you would have Range("CA7").Select. Hope this helps. Pete On Apr 28, 12:58 am, M.A.Tyler <Great Lakes State wrote: I have a sheet with the following macro, actually this is just part of it. If I'm correct it cuts rows from sheet 9 Rows("2:11") and pastes them to sheet 1("A7"). it works fine, however I would like to modify it so that it cuts the rows, but skips columns (cells) BX, BY, BZ in each row. These columns (cells) have formulas that become overwritten when the current macro runs. is there a way to make this work? Sheets("Sheet9").Select Rows("2:11").Select Selection.Copy Sheets("Sheet1").Select Range("A7").Select ActiveSheet.Paste Thanks, M.A.Tyler |
#4
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Both of these worked great!
"Pete_UK" wrote: Instead of your second line: Rows("2:11").Select make this: Range("A2:BW11").Select If you have any data beyond column BZ that you also want to cut/paste, then just repeat the lines you have but with the range CA2:IV11, and instead of Range("A7").Select you would have Range("CA7").Select. Hope this helps. Pete On Apr 28, 12:58 am, M.A.Tyler <Great Lakes State wrote: I have a sheet with the following macro, actually this is just part of it. If I'm correct it cuts rows from sheet 9 Rows("2:11") and pastes them to sheet 1("A7"). it works fine, however I would like to modify it so that it cuts the rows, but skips columns (cells) BX, BY, BZ in each row. These columns (cells) have formulas that become overwritten when the current macro runs. is there a way to make this work? Sheets("Sheet9").Select Rows("2:11").Select Selection.Copy Sheets("Sheet1").Select Range("A7").Select ActiveSheet.Paste Thanks, M.A.Tyler |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
cut and paste macro | Excel Worksheet Functions | |||
Macro needed to Paste Values and prevent Macro operation | Excel Discussion (Misc queries) | |||
Macro needed to Paste Values and prevent Macro operation | Excel Discussion (Misc queries) | |||
Cut&Paste Macro | Excel Worksheet Functions | |||
cut and paste macro? | Excel Discussion (Misc queries) |