If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > PC based Database Applications > Microsoft Excel > Calling a VBA function on a change to a cell

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 03-01-05, 12:07
Zack-Morris Zack-Morris is offline
Registered User
 
Join Date: Mar 2005
Location: Chicago, IL
Posts: 5
Calling a VBA function on a change to a cell

Being fairly new to Visual Basic, especially in an Excel environment, I had a (hopefully) quick question about calling VBA functions. I have tried googling for the needed information, but I just can't find that right set of keywords to get the info I need.

Anyhow, I have a VBA function that I would like to call anytime a change is made to a particular set of cells. At the moment, I have the function set to a button that will execute the function when pressed, but I would like to make the changes more seamless and transparent. I would assume that there is some way to implicity call this function whenever a value in a cell is changed, but I just can't seem to find the function to do this.

I realize that doing this causes a large amount of overhead, but the code I would like to execute is quite small and shouldn't cause too much of an issue. Using conditionals is out, since I have more conditions that would be supported.

If anyone can point me in the right direction, it would be greatly appreciated.
Reply With Quote
  #2 (permalink)  
Old 03-01-05, 12:16
DavidCoutts DavidCoutts is offline
Registered User
 
Join Date: Jan 2004
Location: Aberdeen, Scotland
Posts: 1,067
Worksheet_change event of the worksheet class

i.e. view the code of the worksheet you are looking at then choose the options from the drop down list
Reply With Quote
  #3 (permalink)  
Old 03-01-05, 12:19
Zack-Morris Zack-Morris is offline
Registered User
 
Join Date: Mar 2005
Location: Chicago, IL
Posts: 5
Excellent, thats just what I was looking for! Thanks!
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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