VB - "Stop" showing message in this instance

arnoldmo

New Member
Joined
Feb 23, 2011
Messages
9
Hi my problem is - as anyone enters via a Macro button, a warning message appears as it should, & then takes you to the correct sheet. However part way through working the spreadsheet, a macro collects data from another sheet. the same warning message appears as the macro has left the exiting sheet & re-entered. How can I stop the warning message appear via the macro part way through the sheet??:confused:
 

Excel Facts

Copy formula down without changing references
If you have =SUM(F2:F49) in F50; type Alt+' in F51 to copy =SUM(F2:F49) to F51, leaving the formula in edit mode. Change SUM to COUNT.
Unfortunately without being able to see your code it's difficult to see what it's doing let alone stop the messagebox. :)

Please post your code here in code tags and someone may be able to help
 
Upvote 0
As you enter from front screen I use

Private Sub Worksheet_Activate()
EntryWarning.Show
End Sub

Then it unloads when a button is clicked - using the below code.

Private Sub CommandButton1_Click()
Unload Me
End Sub

Once you are in the spread sheet, (sheet 31) some data is recorded on another page (sheet 30). When this recorded data on sheet 30 is pulled back to sheet 31, the warning message shows again. How can I only make it show at the 1st entry & not when it is pulling data from sheet 30. The coding I use is below to pull the data from sheet 30 is below.

Private Sub CommandButton5_Click()
Sheet30.Activate
Sheet30.Range("A1:F10").Select
Selection.Copy
Sheet31.Activate
Sheet31.Range("E20").Select
MsgBox "You must now paste this information into a new heading"
Application.ScreenUpdating = True
End Sub


xx
 
Upvote 0
Looking at the code it looks as though it is being triggered by the activates in your code:
Code:
Private Sub CommandButton5_Click()
[COLOR=red][B]Sheet30.Activate[/B][/COLOR]
Sheet30.Range("A1:F10").Select
Selection.Copy
[COLOR=red][B]Sheet31.Activate [/B][/COLOR]
Sheet31.Range("E20").Select
MsgBox "You must now paste this information into a new heading"
Application.ScreenUpdating = True
End Sub

I would think this may help:
http://www.mrexcel.com/forum/showthread.php?t=530223&highlight=Sheets%28%29.select
as you don't necessarily need to Activate or use .Select
 
Upvote 0

Forum statistics

Threads
1,224,518
Messages
6,179,261
Members
452,901
Latest member
LisaGo

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top