LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default How can I make this code more efficient?


I need to copy and paste certain rows/columns from one workbook to
another, and I have like hundreds of these. How can I cut it down so
the macro runs faster and I don't have to repeat this code a hundred
times?

Here's my sample:

' Copy and Paste [A]
Windows("" & var_Download_Filename).Activate
Sheets("" & var_Download_sheetname).Select
Range("A" & int_Download_Firstrow & ":A" &
int_Download_Lastrow).Select
Selection.Copy

Windows("" & var_Template_filename).Activate
Sheets("" & var_Template_sheetname).Select
Range("A" & int_Template_Firstrow & ":A" &
int_Template_Lastrow).Select
Selection.PasteSpecial

' Copy and Paste [b]
Windows("" & var_Download_Filename).Activate
Sheets("" & var_Download_sheetname).Select
Range("B" & int_Download_Firstrow & ":B" &
int_Download_Lastrow).Select
Selection.Copy

Windows("" & var_Template_filename).Activate
Sheets("" & var_Template_sheetname).Select
Range("B" & int_Template_Firstrow & ":B" &
int_Template_Lastrow).Select
Selection.PasteSpecial

' Copy and Paste Region [i]
Windows("" & var_Download_Filename).Activate
Sheets("" & var_Download_sheetname).Select
Range("I" & int_Download_Firstrow & ":I" &
int_Download_Lastrow).Select
Selection.Copy

Windows("" & var_Template_filename).Activate
Sheets("" & var_Template_sheetname).Select
Range("C" & int_Template_Firstrow & ":C" &
int_Template_Lastrow).Select
Selection.PasteSpecial


Many thanks!!


--
Sethaholic
------------------------------------------------------------------------
Sethaholic's Profile: http://www.excelforum.com/member.php...o&userid=25113
View this thread: http://www.excelforum.com/showthread...hreadid=567074

 
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
need to make code more efficient (if possible) Lilivati Excel Programming 8 July 7th 06 07:50 PM
Efficient Code GregR Excel Programming 7 June 27th 05 04:09 PM
More Efficient code than this thom hoyle Excel Programming 14 May 11th 05 07:40 AM
Making code more efficient Tommi[_2_] Excel Programming 8 December 13th 03 07:47 PM
More efficient code Rob Bovey Excel Programming 1 July 9th 03 04:46 AM


All times are GMT +1. The time now is 03:24 AM.

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"