Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Make a macro run upon text entry? 1

Status
Not open for further replies.

TulsaJeff

Programmer
Jan 29, 2001
870
US
Hi all,

I am making a log which will track BOM's as I find and correct discrepancies along with the date it is corrected. I wrote a simple macro which will automatically insert todays date in the ActiveCell by pushing a button.

My question... is there a way to have the macro automatically run everytime I insert a BOM in culumn B without having to push the button each time?

Thanks for your help! Ya' Gotta Love It!
sleepyangelsBW.jpg
 
yes...insert your code into the "on change sub" (right click on the sheet name and select view code), then selct the proper event sub from the drop downs...
 
Excuse my ignorance but I have never done anything more than very simple stuff. I do learn fast however. How do you get an "on change Sub"? I did what you said and clicked on my sheet name... selected view code and then inserted my code into the module but there is nothing in the drop downs except the word General on the left side and the word declarations on the right. Nothing about an on change event.

My code is nothing more than inserting the Today() formula in the ActiveCell and then doing a copy and paste to overwrite the formula with the actual text value. Ya' Gotta Love It!
sleepyangelsBW.jpg
 
where it says general ..drop that list down and select workbook, then the right drop down will populate with a list of events subs for you to choose from, you prob. want the "change" event, then an empty sub will show in the bottom frame ...past your code there

then on that worksheet...when any cell changes the code will run.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top