LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #2   Report Post  
Dave Peterson
 
Posts: n/a
Default

Are you copying the worksheet to a new workbook? If yes, then you can do all
your editing, print it and just close that workbook. Since that workbook hasn't
been saved, you don't need to delete it.

Kind of...

Option Explicit
Sub testme()
Dim curWks As Worksheet
Dim newWks As Worksheet

Set curWks = ActiveSheet

curWks.Copy 'to a new workbook

Set newWks = ActiveSheet

With newWks
.Range("a1").Value = "hi there!"
.Range("a1:b99").PrintOut preview:=True
.Parent.Close savechanges:=False
End With

End Sub

(I used preview:=true to save some paper.)



lschuh wrote:

I have created a macro that will open the workbook, print preview, copy a
worksheet. After I create the copy I want to edit the contents then print a
range. Upon exiting I want to delete the copy I created save and close the
workbook. I have been able to do everything except do the editing in the
worksheet before the macro prints, deletes and closes. Any suggestions


--

Dave Peterson
 
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
cannot copy a worksheet within a workbook ROBERT P. SANDOZ Excel Discussion (Misc queries) 3 August 16th 05 04:53 PM
HOW DO I COPY A CONDITIONAL SUM (sumif) AND EDIT IT? (THE SUM NEV. ailsa.fraser Excel Worksheet Functions 5 April 22nd 05 03:10 PM
How do I copy my dropdown box with data to another worksheet? Tess Excel Worksheet Functions 0 February 10th 05 08:33 PM
Date macro Hiking Excel Discussion (Misc queries) 9 February 3rd 05 12:40 AM
How do I edit, copy and paste text in excel cells? floridactyl New Users to Excel 2 December 31st 04 03:52 PM


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