I am using a macro in one of my documents that unhides a specific worksheet, copies a range to the user's clipboard as a bitmap image, and returns to the to the sheet that was active when the macro was executed.
Running the macro while Application.ScreenUpdating = True does exactly what I want it do and I am able to paste the picture with a simple CTRL+V once the macro is finished. I don't, however, want the user to see what is happening when they click the button that triggers the macro so I added Application.ScreenUpdating = False as the first line of the macro and Application.ScreenUpdating = True as the last line of the macro.
This accomplishes the desired effect of not showing the user what is happening behind the scenes, but it pastes a blank picture when I press CTRL+V after the macro has been executed.
Any thoughts?
My code is below:
Sub CopyRaceEthnicityChart()
' Application.ScreenUpdating = False
Sheets("Race and Ethnicity").Visible = True
Sheets("Race and Ethnicity").Activate
ActiveSheet.Range("R17:BY58").Select
Selection.CopyPicture Appearance:=xlScreen, Format:=xlBitmap
Sheets("Race and Ethnicity").Select
ActiveWindow.SelectedSheets.Visible = False
Sheets("Outputs").Activate
ActiveSheet.Range("A93").Select
' Application.ScreenUpdating = True
End Sub
Bookmarks