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
-- Don Guillett Microsoft MVP Excel SalesAid Software dguillett1[ at ]austin.rr.com "Don Guillett" <dguillett1[ at ]austin.rr.com> wrote in message news:u1FHpwsaJHA.4792[ at ]TK2MSFTNGP04.phx.gbl...
[Quoted Text] > 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 > > > -- > Don Guillett > Microsoft MVP Excel > SalesAid Software > dguillett1[ at ]austin.rr.com > "PR" <paul.raeburn[ at ]vodafone.net> wrote in message > news:ux12mtsaJHA.3952[ at ]TK2MSFTNGP05.phx.gbl... >> 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 >> >
|