Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
No Name
 
Posts: n/a
Default If statement and Macros

Hi there,

I would appreciate some help woth the following: I want
to run a macro that allows a "clip" to appear if a cell
in Excel gets a certain value. I thought of using an If
statement, but don't seem to get the if statement to
accept a macro. Any help?

Thanks

Andre
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default If statement and Macros

Andre,

You can't do that, Excel does not allow it.

You could use VBA event code to trap a change and then run your macro,
something like


Private Sub Worksheet_Change(ByVal Target As Range)

On Error GoTo ws_exit:
Application.EnableEvents = False
If Not Intersect(Target, Me.Range("A1")) Is Nothing Then
With Target
'do something
End With
End If

ws_exit:
Application.EnableEvents = True
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.

Change the A1 to whichever cell (or cells) that apply.

--

HTH

RP

wrote in message
...
Hi there,

I would appreciate some help woth the following: I want
to run a macro that allows a "clip" to appear if a cell
in Excel gets a certain value. I thought of using an If
statement, but don't seem to get the if statement to
accept a macro. Any help?

Thanks

Andre



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,236
Default If statement and Macros

You could use an IF statement and format the cell with a font like
Wingdings.

Not sure if there is a clip looking character though.

--
Rob van Gelder - http://www.vangelder.co.nz/excel


wrote in message
...
Hi there,

I would appreciate some help woth the following: I want
to run a macro that allows a "clip" to appear if a cell
in Excel gets a certain value. I thought of using an If
statement, but don't seem to get the if statement to
accept a macro. Any help?

Thanks

Andre



  #4   Report Post  
Posted to microsoft.public.excel.programming
No Name
 
Posts: n/a
Default If statement and Macros

Bob,

Thanks for the effort in replying. I'm afraid my Excel
skills do not allow me to fully grasp this. I added the
routine to the sheet code as you said, but still cant get
it to work :( Could I mail you the sheet and you put it
it for me?? I know I'm really pushing it now, but hoped
you would be so kind :)

Regards

Andre
-----Original Message-----
Andre,

You can't do that, Excel does not allow it.

You could use VBA event code to trap a change and then

run your macro,
something like


Private Sub Worksheet_Change(ByVal Target As Range)

On Error GoTo ws_exit:
Application.EnableEvents = False
If Not Intersect(Target, Me.Range("A1")) Is Nothing

Then
With Target
'do something
End With
End If

ws_exit:
Application.EnableEvents = True
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.

Change the A1 to whichever cell (or cells) that apply.

--

HTH

RP

wrote in message
...
Hi there,

I would appreciate some help woth the following: I

want
to run a macro that allows a "clip" to appear if a cell
in Excel gets a certain value. I thought of using an

If
statement, but don't seem to get the if statement to
accept a macro. Any help?

Thanks

Andre



.

  #5   Report Post  
Posted to microsoft.public.excel.programming
No Name
 
Posts: n/a
Default If statement and Macros

Thanks Rob,

That is where I am now, but there are only 3 face icons
in my Wingding dictionary. I need 5 (0-20, 21-40, 41-
60,61-80, 81-100). Bob explained in another post how to
really go about it, but, I'm not clued up enough on Excel
to know what he is talking about :( Will have to work at
it a bit more. Thanks for replying.

Andre


-----Original Message-----
You could use an IF statement and format the cell with a

font like
Wingdings.

Not sure if there is a clip looking character though.

--
Rob van Gelder - http://www.vangelder.co.nz/excel


wrote in message
...
Hi there,

I would appreciate some help woth the following: I

want
to run a macro that allows a "clip" to appear if a cell
in Excel gets a certain value. I thought of using an

If
statement, but don't seem to get the if statement to
accept a macro. Any help?

Thanks

Andre



.



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default If statement and Macros

Sure, send it over

Bob <dot Phillips <at tiscali <dot co <dot uk

I am sure you know how to use it

--

HTH

RP

wrote in message
...
Bob,

Thanks for the effort in replying. I'm afraid my Excel
skills do not allow me to fully grasp this. I added the
routine to the sheet code as you said, but still cant get
it to work :( Could I mail you the sheet and you put it
it for me?? I know I'm really pushing it now, but hoped
you would be so kind :)

Regards

Andre
-----Original Message-----
Andre,

You can't do that, Excel does not allow it.

You could use VBA event code to trap a change and then

run your macro,
something like


Private Sub Worksheet_Change(ByVal Target As Range)

On Error GoTo ws_exit:
Application.EnableEvents = False
If Not Intersect(Target, Me.Range("A1")) Is Nothing

Then
With Target
'do something
End With
End If

ws_exit:
Application.EnableEvents = True
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.

Change the A1 to whichever cell (or cells) that apply.

--

HTH

RP

wrote in message
...
Hi there,

I would appreciate some help woth the following: I

want
to run a macro that allows a "clip" to appear if a cell
in Excel gets a certain value. I thought of using an

If
statement, but don't seem to get the if statement to
accept a macro. Any help?

Thanks

Andre



.



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
IF statement inside a SUMIF statement.... or alternative method Sungibungi Excel Worksheet Functions 3 December 4th 09 06:22 PM
Reconcile Bank statement & Credit card statement & accounting data Bklynhyc Excel Worksheet Functions 0 October 7th 09 09:07 PM
Run Macros from an IF statement within a formula LW_Greeney Excel Discussion (Misc queries) 5 September 25th 07 07:12 PM
convert lotus 123w macros to excel macros rpiescik[_2_] Excel Programming 1 September 19th 04 12:41 PM
Macros not appearing in the Tools Macro Macros list hglamy[_2_] Excel Programming 5 October 24th 03 09:10 AM


All times are GMT +1. The time now is 12:40 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"