If statement and Macros

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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
 
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.
 
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.
 
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
 
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
 
Sure, send it over

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

I am sure you know how to use it
 

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