Run macro Once

  • Thread starter Thread starter PR
  • Start date Start date
P

PR

Can anyone let me know how to get this code to work when there is a null
entry in X1...

Worksheets("qry_aga_corps").Activate
Range("X1").Select
If ActiveCell isnull Then

"Run Code"

Else
MsgBox ("The Macro has already been activiated once, cannot run
twice")
End If

Regards - Paul
 
with Worksheets("qry_aga_corps")
if len(trim(Range("X1")))<1 then
"Run Code"
'I assume that code puts somehing in cell x1
Else
MsgBox ("The Macro has been run once, cannot run twice")
End If
 
OOPS
with Worksheets("qry_aga_corps")
if len(application.trim(.Range("X1")))<1 then
"Run Code"
'I assume that code puts somehing in cell x1
Else
MsgBox ("The Macro has been run once, cannot run twice")
End If
end with
 

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