+ Reply to Thread
Results 1 to 5 of 5

Hiding New Workbook created using Macro Recorder

  1. #1
    Registered User
    Join Date
    05-27-2006
    Location
    Oldham, England
    Posts
    20

    Question Hiding New Workbook created using Macro Recorder

    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

  2. #2
    Paul B
    Guest

    Re: Hiding New Workbook created using Macro Recorder

    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

    "deelee" <deelee.29yhp1_1151235908.6796@excelforum-nospam.com> wrote in
    message news:deelee.29yhp1_1151235908.6796@excelforum-nospam.com...
    >
    > 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
    >
    >
    > --
    > deelee
    > ------------------------------------------------------------------------
    > deelee's Profile:

    http://www.excelforum.com/member.php...o&userid=34866
    > View this thread: http://www.excelforum.com/showthread...hreadid=555343
    >




  3. #3
    Don Guillett
    Guest

    Re: Hiding New Workbook created using Macro Recorder

    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




    --
    Don Guillett
    SalesAid Software
    dguillett1@austin.rr.com
    "deelee" <deelee.29yhp1_1151235908.6796@excelforum-nospam.com> wrote in
    message news:deelee.29yhp1_1151235908.6796@excelforum-nospam.com...
    >
    > 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
    >
    >
    > --
    > deelee
    > ------------------------------------------------------------------------
    > deelee's Profile:
    > http://www.excelforum.com/member.php...o&userid=34866
    > View this thread: http://www.excelforum.com/showthread...hreadid=555343
    >




  4. #4
    Registered User
    Join Date
    05-27-2006
    Location
    Oldham, England
    Posts
    20
    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

  5. #5
    Paul B
    Guest

    Re: Hiding New Workbook created using Macro Recorder

    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

    "deelee" <deelee.29yjrz_1151238602.34@excelforum-nospam.com> wrote in
    message news:deelee.29yjrz_1151238602.34@excelforum-nospam.com...
    >
    > 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
    >
    >
    > --
    > deelee
    > ------------------------------------------------------------------------
    > deelee's Profile:

    http://www.excelforum.com/member.php...o&userid=34866
    > View this thread: http://www.excelforum.com/showthread...hreadid=555343
    >




+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1