Hiding New Workbook created using Macro Recorder

D

deelee

Hi,

Not being familiar with VBA ,I've created a new single sheet Workbook;
copied the data from one worksheet; set column widths to match original
and created the print setup all, using the Macro Recorder.

My question is this, because I used the recorder (I assume) the new
workbook/sheet flickers a lot whilst formatting etc takes place - Is
there a way to hide the new wookbook until the macro has completed?

Thanks in advance,

Dave
 
P

Paul B

Dave, you could most likely modify the code that you got from the recorder
and make it run with out the flickers but the easiest way for you may be to
just turn off Screen Updating , like this

Application.ScreenUpdating = False

'*****Your code Here*****

Application.ScreenUpdating = True


--
Paul B
Always backup your data before trying something new
Please post any response to the newsgroups so others can benefit from it
Feedback on answers is always appreciated!
Using Excel 2002 & 2003
 
D

Don Guillett

As ALWAYS, post your code for comments. You need to remove the selections
which should not be necessary.

Here is a recorded macro to copy a worksheet to a new workbook and rename
it.
Sub Macro1()
'
' Macro1 Macro
' Macro recorded 6/25/2006 by Don Guillett
'

'
' Sheets("Sheet2").Select 'NOT needed so removed or commented out
Sheets("Sheet2").Copy
ActiveWorkbook.SaveAs Filename:="C:\yourfoldername\newbook1.xls",
FileFormat:= _
xlNormal, Password:="", WriteResPassword:="",
ReadOnlyRecommended:=False _
, CreateBackup:=False
End Sub
 
D

deelee

:) Hi Paul and thank you!

That works a treat - although I was very pleased with the outcome of my
macro, my professional pride wouldn't allow me to have a 'flickery'
screen! :)

What an helpful group you all are!

Thanks again,

Dave
 
P

Paul B

Your Welcome

--
Paul B
Always backup your data before trying something new
Please post any response to the newsgroups so others can benefit from it
Feedback on answers is always appreciated!
Using Excel 2002 & 2003
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top