#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 100
Default Cut and Paste Macro

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   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 4,624
Default Cut and Paste Macro

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   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 8,856
Default Cut and Paste Macro

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   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 100
Default Cut and Paste Macro

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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
cut and paste macro wally Excel Worksheet Functions 6 December 12th 06 03:51 PM
Macro needed to Paste Values and prevent Macro operation thunderfoot Excel Discussion (Misc queries) 1 June 11th 05 12:44 AM
Macro needed to Paste Values and prevent Macro operation thunderfoot Excel Discussion (Misc queries) 0 June 10th 05 03:38 PM
Cut&Paste Macro [email protected] Excel Worksheet Functions 5 April 8th 05 03:51 PM
cut and paste macro? VBA12thRoundDraftPick Excel Discussion (Misc queries) 1 April 1st 05 10:09 PM


All times are GMT +1. The time now is 05:19 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"