User form to enter data into spreadsheet

Asked By Bree L
07-Sep-10 12:29 AM
Earn up to 0 extra points for answering this tough question.
Hello,

I would like to be able to create a user form that will enter a series of numbers into an excel spreadsheet.

I am able to create the user form, but I have difficulty completing the necessary coding.

For each new time the user form is accessed I need the data to replace the old data.

Ie. if I enter 5% in the text box, it will hit cell C5
the next time I enter data into the user form (eg. this time 7%) I need it to put into C5 and replace previous content.

Any help would be greatly appreciated!!!
Cheers

  re: User form to enter data into spreadsheet

Rolf Jaeger replied to Bree L
07-Sep-10 02:57 PM

Hi Bree:

when in Designer mode right-clicking on any of your textboxes and selecting 'View Code' from the pull-down menu wil bring up the code editor with the default 'Textbox_Change' event handler for that TextBox. Modifying that event handler as follows should do the trick for you:

Private Sub TextBox1_Change()
  Range("A5").Value = TextBox1.Text
End Sub

Hope this helped,
Rolf
Create New Account