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: 30
Default Improve macro help

I have the following code that works fine and does what I need it to do. What
I am wondering is if there is a way to improve the code inside the if
statement so that the 2 workbooks do not need to be alternately selected.
Thus I hope speed up the macro.

The bit inside takes a range of 120 cells in one row from "FromWorkbook"
then selects "ToWorkbook" and the first cell where the range is to be pasted
and then pastes the data.

If Workbooks(ToWorkbook).Sheets("LTDIS pay").Cells(j, 1).Value =
Workbooks(FromWorkbook).Sheets(1).Cells(i, 3).Value, 2) Then

Workbooks(FromWorkbook).Sheets(1).Activate
Range(Cells(i, 7), Cells(i, 127)).Copy
Workbooks(ToWorkbook).Sheets("LTDIS pay").Activate
Cells(j, 2).Select
ActiveSheet.Paste

End If

Many thanks in advance.
 
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
Anyone help to improve my code? Andrew[_53_] Excel Programming 3 May 5th 06 03:09 PM
improve DeleteBlankRows() Bucky[_2_] Excel Programming 2 March 10th 06 11:20 PM
Help to improve macro unni5959 Excel Programming 9 September 19th 05 11:44 PM
Can you help me to improve this macro? Dario de Judicibus[_3_] Excel Programming 5 June 15th 05 10:59 AM
Please help me improve macro to convert spreadsheet to tabular for Nigel Excel Programming 1 July 30th 04 02:54 PM


All times are GMT +1. The time now is 05:02 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"