+ Reply to Thread
Results 1 to 2 of 2

Automatically blank a worksheet on startup

Hybrid View

  1. #1
    Registered User
    Join Date
    07-19-2007
    Posts
    3

    Automatically blank a worksheet on startup

    I have a spreadsheet which has a macro that runs on workbook open. It does a web query to update data. What I want to do is blank the screen (I change the text to white on white) while the query is running so the user is not confused by the old data and then change the updated text back to normal colours after the query is complete.

    However on startup the spreadsheet displays normally for a second or two before it is blanked.

    I can start from a blank screen but I would like to allow the user to save the workbook (so they have the most recent data in case the query fails). Then when they open the workbook next they will be starting from the data sheet or wherever they were when they saved.

    I tried using a BeforeClose event to blank the data but the blanking occurs before the prompt to save so it is disconcerting since it looks to the user like they are saving a blank sheet.

    Is there any way to run the macro before anything is displayed?

    This was previously posted on http://www.mrexcel.com/board2/viewto...125&highlight=

  2. #2
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200
    i would go with having a hidden sheet blank or with a simple message -"Data is being updated"

    Private Sub Workbook_Open()
        Application.ScreenUpdating = False
        With Worksheets("Blank")
            .Visible = xlSheetVisible
            .Select
            'run query
            .Visible = xlSheetVeryHidden
            Worksheets("data").Select
        End With
        Application.ScreenUpdating = True
    End Sub
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

+ 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