ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Help with a User Input Form (https://www.excelbanter.com/excel-programming/279176-help-user-input-form.html)

Cody Dawg[_2_]

Help with a User Input Form
 
Just want to say up front that this user group is very helpful and
supportive and has been an invaluable resource for me as I learn excel
programming.

My current challenge is to develop a user input form that would pop up from
a command button on the active worksheet and prompt the user to input up to
13 different numbers for the day. Once the form is filled out the user
would then press an "Accept" command button and the numbers in the form
would then go assigned cells in the active worksheet.

I'm able to put together the form and command buttons, etc., but cannot
figure out the way to have the numbers in the form go to specific cells on
the active worksheet.

TEA



merjet

Help with a User Input Form
 
I'm able to put together the form and command buttons, etc., but cannot
figure out the way to have the numbers in the form go to specific cells on
the active worksheet.


If you don't mind the contents of the cells appearing in the TextBoxes
when the UserForm is shown, you can use the TextBox's ControlSource
property, e.g. Sheet1!A1. Or you can put code behind the "accept"
CommandButton, e.g.:
Sheets("Sheet1").Range("A1") = TextBox1.Text 'or
Sheets("Sheet1").Range("A1") = TextBox1.Text 'or
ActiveSheet.Range("A1") = TextBox1 'or
ActiveSheet.Range("A1") = TextBox1.Text

HTH,
Merjet



Cody Dawg[_2_]

Help with a User Input Form
 
Thanks,

but the problem with this is that as you input data into the form, it goes
straight to the worksheet and can't be undone. I should have stated this
earlier, but one of the purposes of this form is to give the user a chance
to review the data entered before accepting it and sending it to the sheet.
So the form acts as a kind of "data buffer".

Any suggestions will be appreciated.

"merjet" wrote in message
. net...
I'm able to put together the form and command buttons, etc., but cannot
figure out the way to have the numbers in the form go to specific cells

on
the active worksheet.


If you don't mind the contents of the cells appearing in the TextBoxes
when the UserForm is shown, you can use the TextBox's ControlSource
property, e.g. Sheet1!A1. Or you can put code behind the "accept"
CommandButton, e.g.:
Sheets("Sheet1").Range("A1") = TextBox1.Text 'or
Sheets("Sheet1").Range("A1") = TextBox1.Text 'or
ActiveSheet.Range("A1") = TextBox1 'or
ActiveSheet.Range("A1") = TextBox1.Text

HTH,
Merjet





merjet

Help with a User Input Form
 
You can use the code approach, with checks
before it, that I suggested.

HTH,
Merjet
"Cody Dawg" wrote in message
...
Thanks,

but the problem with this is that as you input data into the form, it goes
straight to the worksheet and can't be undone. I should have stated this
earlier, but one of the purposes of this form is to give the user a

chance
to review the data entered before accepting it and sending it to the

sheet.
So the form acts as a kind of "data buffer".

Any suggestions will be appreciated.

"merjet" wrote in message
. net...
I'm able to put together the form and command buttons, etc., but

cannot
figure out the way to have the numbers in the form go to specific

cells
on
the active worksheet.


If you don't mind the contents of the cells appearing in the TextBoxes
when the UserForm is shown, you can use the TextBox's ControlSource
property, e.g. Sheet1!A1. Or you can put code behind the "accept"
CommandButton, e.g.:
Sheets("Sheet1").Range("A1") = TextBox1.Text 'or
Sheets("Sheet1").Range("A1") = TextBox1.Text 'or
ActiveSheet.Range("A1") = TextBox1 'or
ActiveSheet.Range("A1") = TextBox1.Text

HTH,
Merjet








All times are GMT +1. The time now is 06:27 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com