activate VBA

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

Guest

hi,

i would like to know how i can activate a VBA sub celltoast() when i click a
cell in MS excel. is this possible? if so, how?

thanks in advance,
geebee
 
its not working. nothing is hapening. i made sur that the code is in the
ThisWorkBook section instead of a separate module. And I havea sub called
celltoast(). not a macro, but a sub. i even added a messagebox to the code
you gave me, but im not getting a messagebox to appear. what am i doing
wrong?

thanks in advance,
geebee
 
You are being a litle too creative. There should be no sub test().

After you hve right-clicked and selected View Code, erase EVERYTHING you see.

paste in the following:

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Intersect(Target, Range("Z100")) Is Nothing Then
Exit Sub
End If
Application.EnableEvents = False
Call celltoast
Application.EnableEvents = True
End Sub

Please note that "Worksheet_SelectionChange" is a special name. You can't
change it to test.

Then close the VBA window.

Re-open VBA and then make sure YOUR sub celltoast is in the standard module.
 

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

Similar Threads

show value of formula 3
change formula dynamically 1
onCHange event 1
select last dirtied cell 3
format number 2
right click 3
ignore error 1
select listbox item 1

Back
Top