I'm having great difficulty doing something I feel ought to be quite simple!
I want to use a series of textboxes within a userform to display the
contents of about a dozen particular cells on a particular worksheet. The
intention
is for a user to then alter the data (if necessary) and, on clicking a
command button, for the new data to be written back to the worksheet.
1 If I use the ControlSource property of the textBox control to specify
the appropriate cells, the userform correctly displays the data. However, any
changes that are made to the userform are automatically transferred to the
worksheet on hitting either the tab or enter keys. I only want the changes to
be made to the worksheet on the click of a command button.
2 If I don't use the ControlSource property, the userform displays
whatever values are held in (for example) TextBox1.Text (and Textbox1.Value),
not
what is on the worksheet. I have tried writing code such as Textbox1.Text =
Cells (1,2) but, although it does not generate an error, it is simply ignored.
In short, I effectively want to read a small number of cells, display the
values, and then give a user the opportunity to alter the values but for any
changes to be implemented to the worksheet only on the pressing of a command
button. As I am relatively new to VBA, I may be barking up the wrong tree
completely but any pointers anyone is willing to give are greatly appreciated.