Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Event Change Question


I have two drop downs: one selecting month, and the other a year. I
would like it when one of these changes, it runs a macro. Sounds
simple...but I could not get anything successfully done.

Any help is much appreciated!


--
pikapika13
------------------------------------------------------------------------
pikapika13's Profile: http://www.excelforum.com/member.php...o&userid=10892
View this thread: http://www.excelforum.com/showthread...hreadid=557898

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,593
Default Event Change Question

Private Sub Worksheet_Change(ByVal Target As Range)

On Error GoTo ws_exit:
Application.EnableEvents = False
If Target.Address = "$A$2" Then 'one of the DD cells
'do your stuff
ElseIf Target.Address = "$A$5" Then 'other DD cells
'do other stuff
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.



--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"pikapika13" wrote
in message ...

I have two drop downs: one selecting month, and the other a year. I
would like it when one of these changes, it runs a macro. Sounds
simple...but I could not get anything successfully done.

Any help is much appreciated!


--
pikapika13
------------------------------------------------------------------------
pikapika13's Profile:

http://www.excelforum.com/member.php...o&userid=10892
View this thread: http://www.excelforum.com/showthread...hreadid=557898



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Event Change Question


I think this is a good start, but I'm still having some problems. I'm
still new to VBA. In the address below, am I supposed to put in the
linked cell? If so, it doesn't work. Choosing the month will change
this cell's value, but the macro won't kick off. However, when I
manually change it, it does.

If I'm supposed to have the address be where the DD is located, I don't
know how to place the DD in that cell; it seems to just float over it.


"If Target.Address = "$A$7" Then 'one of the DD cells"


--
pikapika13
------------------------------------------------------------------------
pikapika13's Profile: http://www.excelforum.com/member.php...o&userid=10892
View this thread: http://www.excelforum.com/showthread...hreadid=557898

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,593
Default Event Change Question

I have assumed Data Validation, not a combobox?

--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"pikapika13" wrote
in message ...

I think this is a good start, but I'm still having some problems. I'm
still new to VBA. In the address below, am I supposed to put in the
linked cell? If so, it doesn't work. Choosing the month will change
this cell's value, but the macro won't kick off. However, when I
manually change it, it does.

If I'm supposed to have the address be where the DD is located, I don't
know how to place the DD in that cell; it seems to just float over it.


"If Target.Address = "$A$7" Then 'one of the DD cells"


--
pikapika13
------------------------------------------------------------------------
pikapika13's Profile:

http://www.excelforum.com/member.php...o&userid=10892
View this thread: http://www.excelforum.com/showthread...hreadid=557898



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Event Change Question


Wow...I dont' even know the difference. If I right-click on the box an
choose format control, the last tab "Control" is availabe to link it t
a range, cells, and number of drop down lines. I wouldn't even kno
how to create this from scatch. I copied this box from somewhere else

--
pikapika1
-----------------------------------------------------------------------
pikapika13's Profile: http://www.excelforum.com/member.php...fo&userid=1089
View this thread: http://www.excelforum.com/showthread.php?threadid=55789



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,593
Default Event Change Question

I cannot see that tab on my Excel, neither with a forms button, a controls
toolbox button, so I don't know which you have.

--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"pikapika13" wrote
in message ...

Wow...I dont' even know the difference. If I right-click on the box and
choose format control, the last tab "Control" is availabe to link it to
a range, cells, and number of drop down lines. I wouldn't even know
how to create this from scatch. I copied this box from somewhere else.


--
pikapika13
------------------------------------------------------------------------
pikapika13's Profile:

http://www.excelforum.com/member.php...o&userid=10892
View this thread: http://www.excelforum.com/showthread...hreadid=557898



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
Quick VBA Worksheet Change Event or Selection Question: Damil4real Excel Worksheet Functions 6 November 17th 09 10:28 PM
MsgBox in Enter event causes combobox not to run Change event Richard Excel Programming 0 March 6th 06 02:52 PM
Another change event question Steph[_3_] Excel Programming 12 January 27th 05 10:41 PM
Sheet change event and list validation question Nick Excel Programming 1 October 21st 04 01:20 PM
change event question scott23 Excel Programming 3 May 13th 04 01:55 PM


All times are GMT +1. The time now is 07:12 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"