Group:  Microsoft Excel ยป microsoft.public.excel.worksheet.functions
Thread: Run macro Once

Geek News

Run macro Once
"PR" <paul.raeburn[ at ]vodafone.net> 12/30/2008 10:10:16 PM
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


Re: Run macro Once
"Don Guillett" <dguillett1[ at ]austin.rr.com> 12/30/2008 10:15:29 PM
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...
[Quoted Text]
> 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
>

Re: Run macro Once
"Don Guillett" <dguillett1[ at ]austin.rr.com> 12/30/2008 10:26:21 PM
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
>>
>

Re: Run macro Once
"PR" <paul.raeburn[ at ]vodafone.net> 12/31/2008 6:05:52 PM
Don,
Many thanks for your help and your time it works...

regards Paul


Re: Run macro Once
"Don Guillett" <dguillett1[ at ]austin.rr.com> 12/31/2008 7:59:07 PM
Glad to help.

--
Don Guillett
Microsoft MVP Excel
SalesAid Software
dguillett1[ at ]austin.rr.com
"PR" <paul.raeburn[ at ]vodafone.net> wrote in message
news:OcKstJ3aJHA.3748[ at ]TK2MSFTNGP06.phx.gbl...
[Quoted Text]
> Don,
> Many thanks for your help and your time it works...
>
> regards Paul
>

Home | Search | Terms | Imprint Contact
Newsgroups Reader - provided by WiredBox.Net