View Single Post
  #16   Report Post  
Posted to microsoft.public.excel.programming
Jim at Eagle Jim at Eagle is offline
external usenet poster
 
Posts: 83
Default Macro to run if cell empty

Thanks just what I needed to get my brain working

"Bob Phillips" wrote:

Greg,

You could use workbook_open then, something like


Private Sub Workbook_Open()
If Worksheets("Sheet1").Range("A1") = "" Then
Userform1.Show
Worksheets("Sheet1").Range("A1") = "X"
Else
'do something else
End If
End Sub


'This is workbook event code.
'To input this code, right click on the Excel icon on the worksheet
'(or next to the File menu if you maximise your workbooks),
'select View Code from the menu, and paste the code



--

HTH

RP
(remove nothere from the email address if mailing direct)


"Greg" wrote in message
...
I wanted to run a userform once when this workbook is loaded for the first
time. I needed the user to place some information information in this

form.
Once this userform is used I did not want it to load up again.

Not sure how to do this exactly though maybe it could look up the cell

where
this information would be placed. If empty run a macro and then once the
form has been used it will have the information in the cell so it would

not
be run again.

Thanks again any help is appreciated

Greg