Using the "change" event

tpberks

New Member
Joined
Aug 16, 2011
Messages
3
Hi, I am having real problems getting to grips with change event handling. I have created a user form that has invoice number, date and amount on it. The form works OK and allows the user to select a row in the spreadsheet and then it displayes the details on the form. I want the user to input the row number, between 7 and 30, of the invoice they want to change. This works OK for a single digit row number but if I try to input "23" for example, the change event kicks in and my error checking (correctly) says that the row number is invalid. I have several other instances where I need to be able to key in all the data in a field before the event triggers. What am I doing wrong?
 

Excel Facts

Links? Where??
If Excel says you have links but you can't find them, go to Formulas, Name Manager. Look for old links to dead workbooks & delete.
Move your code to the "Exit" event container. Then your macro would run with the user tabs out of that particular field.
 
Upvote 0
Thanks Sthrncali for your quick response. Yes, I have tried that but the user has to either tab out of the box to another field or press the enter key, to activate the Save cmnd button, neither of which is obvious if they just want to correct one entry. To get around this, for example on the select row number box, I have had to put a "Go" command button so that the user has to exit the field. Having done that, I may as well activate on the go button instead. However, I have realised that what I was hoping would happen in the "change" event cannot possibly work, so I am learning. I think you are right and the "exit" event is the best to use. If I set the focus to the invoice number box, when the user clicks to another box, the Save button will enable. Unfortunately, if the user just wants to change the field in focus, this will not enable the Save button.
 
Upvote 0

Forum statistics

Threads
1,224,542
Messages
6,179,424
Members
452,914
Latest member
echoix

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top