ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   UserForms (https://www.excelbanter.com/excel-discussion-misc-queries/54062-userforms.html)

bennyob

UserForms
 
What is the simplest code for delivering numerical data from a text box to a
specific location (no loops etc to find empty cells) in specific worksheets?
I want several data entries from the same form to go to different worksheets.
Any help will be greatly appreciated
Cheers Ben


Bob Phillips

UserForms
 
Worksheets("sheetname").Range("A1").Value = TextBox1.Text

etc.

--

HTH

RP
(remove nothere from the email address if mailing direct)


"bennyob" wrote in message
...
What is the simplest code for delivering numerical data from a text box to

a
specific location (no loops etc to find empty cells) in specific

worksheets?
I want several data entries from the same form to go to different

worksheets.
Any help will be greatly appreciated
Cheers Ben




bennyob

UserForms
 
Thanks Bob
one more quick one
How do I get it to put the same text box value into several sheets, the
Array function I cannot get to work?
Cheers Ben

"Bob Phillips" wrote:

Worksheets("sheetname").Range("A1").Value = TextBox1.Text

etc.

--

HTH

RP
(remove nothere from the email address if mailing direct)


"bennyob" wrote in message
...
What is the simplest code for delivering numerical data from a text box to

a
specific location (no loops etc to find empty cells) in specific

worksheets?
I want several data entries from the same form to go to different

worksheets.
Any help will be greatly appreciated
Cheers Ben





Bob Phillips

UserForms
 
I think you have to set them all individually.

--

HTH

RP
(remove nothere from the email address if mailing direct)


"bennyob" wrote in message
...
Thanks Bob
one more quick one
How do I get it to put the same text box value into several sheets, the
Array function I cannot get to work?
Cheers Ben

"Bob Phillips" wrote:

Worksheets("sheetname").Range("A1").Value = TextBox1.Text

etc.

--

HTH

RP
(remove nothere from the email address if mailing direct)


"bennyob" wrote in message
...
What is the simplest code for delivering numerical data from a text

box to
a
specific location (no loops etc to find empty cells) in specific

worksheets?
I want several data entries from the same form to go to different

worksheets.
Any help will be greatly appreciated
Cheers Ben







Dave Peterson

UserForms
 
dim myNames as Variant
dim iCtr as long
myNames = array("sheet1","sheet2","sheet99")

for ictr = lbound(mynames) to ubound(mynames)
worksheets(mynames(ictr)).range("a1").value = textbox1.text
next ictr

======
Depending on where/what that textbox is, you may want to qualify it, too.

worksheets("sheet77").TextBox1.Text
or
me.textbox1.text
???



bennyob wrote:

Thanks Bob
one more quick one
How do I get it to put the same text box value into several sheets, the
Array function I cannot get to work?
Cheers Ben

"Bob Phillips" wrote:

Worksheets("sheetname").Range("A1").Value = TextBox1.Text

etc.

--

HTH

RP
(remove nothere from the email address if mailing direct)


"bennyob" wrote in message
...
What is the simplest code for delivering numerical data from a text box to

a
specific location (no loops etc to find empty cells) in specific

worksheets?
I want several data entries from the same form to go to different

worksheets.
Any help will be greatly appreciated
Cheers Ben





--

Dave Peterson


All times are GMT +1. The time now is 08:21 AM.

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