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: 11
Default More efficient code than this?

Hello all,

I recorded this macro using Excel's Macro Recorder and making tweaks
afterwards. After reading up on VBA I have a feeling that the code is
probably bloated with unecessary commands/lines. It also runs fairly slow on
my computer.

What the macro does is copy a worksheet to a new book, copies that whole
sheet and pastes special as values. Then it does a save as and closes...

Sub Macro1()

Sheets("Invoice").Select
Sheets("Invoice").Copy
Cells.Select
Range("C11").Activate
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False

ActiveWorkbook.SaveAs "C:\Documents and Settings\GIT " & Range("G8") & ".xls"
ActiveWorkbook.Close
End Sub
 
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
More efficient code Bob Excel Programming 3 June 7th 07 09:44 PM
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
More efficient code Rob Bovey Excel Programming 1 July 9th 03 04:46 AM


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