Conditional load of form when entering a certain worksheet

  • Thread starter Thread starter davo64
  • Start date Start date
D

davo64

I'm pretty new to Excel VB and brand new to this forum. Hope someon
can help with my scenario.

I have a workbook with multiple worksheets. two particular sheets ge
data from other sheets. I want a form to open if the value of a cel
in that worksheet is not equal to zero. I enter the sheet (named dd
by clicking the tab at the bottom. in my mind i'm thinking:

on enter worksheet dd, if cell J55<>0, then load Userform1

Userform1 is one I already created. Would I add the code under th
worksheet object or need to create a module or constantly runnin
macro???

Thanks.
Davo6
 
Private Sub Worksheet_Activate()
If Me.Range("J55").Value <> 0 Then
Show UserForm1
End If
End Sub

'This is worksheet event code, which means that it needs to be
'placed in the appropriate worksheet code module, not a standard
'code module. To do this, right-click on the sheet tab, select
'the View Code option from the menu, and paste the code in.
 

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

Back
Top