View Single Post
  #12   Report Post  
Posted to microsoft.public.excel.programming
NickHK NickHK is offline
external usenet poster
 
Posts: 4,391
Default Copy & Paste code more efficient

As well as all the other good advice:
The macro recorder generates many Windows(xxx) statements, presumably
because it is working graphically.
However, normally it is better (or necessary) to work with the
Workbooks(xxx) object instead.
Unless you are changing the appearance of the window (position, zoom, panes,
etc) work with a workbook object.

NickHK

"Desert Piranha"
<Desert.Piranha.2clv16_1155685510.3865@excelforu m-nospam.com wrote in
message news:Desert.Piranha.2clv16_1155685510.3865@excelfo rum-nospam.com...

Hi Dave,

Thx this works great.

Drop the continuation character:

Workbooks("UCPSITE-06.xls").Sheets("UCP SITE - Totals") _
Range("BK227:BK304").Copy

'new line of code!
Workbooks("3140UCP2006WithShell.xls")
Sheets("3140 UCP Totals 2006").Range("BK3").PasteSpecial _
Paste:=xlValues, Operation:=xlNone, SkipBlanks:= False,
Transpose:=False

Carlos,
Thx, Yeah, its easy to see i'm useing the recorder. i'm trying to do it
on my own,
rather than just asking someone to write it for me. Thx for your help.

Ron,
Thx for your help.

I got a whole pargraph of code to a couple lines.


--
Desert Piranha


------------------------------------------------------------------------
Desert Piranha's Profile:

http://www.excelforum.com/member.php...o&userid=28934
View this thread: http://www.excelforum.com/showthread...hreadid=571946