Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 17
Default Textbox data to cell

My userform has a TextBox for First Name , Last Name and Employee #. What I
need to know is, how can I put the contents of all 3 Textboxes into one cell?

Example:

Last Name, First Name - Employee #
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,942
Default Textbox data to cell

hi
this should do it. adjust ranges to suit.
Range("C5").Value = _
Me.TextBox2.Value & ", " & Me.TextBox1.Value & " - " & Me.TextBox3.Value

regards
FSt1

"Dave Peterson" wrote:

Dim SomeCell as range

Set somecell = activesheet.range("a1")
somecell.value _
= me.textbox2.value & ", " & me.textbox1.value & " - " & me.textbox3.value



Pats wrote:

My userform has a TextBox for First Name , Last Name and Employee #. What I
need to know is, how can I put the contents of all 3 Textboxes into one cell?

Example:

Last Name, First Name - Employee #


--

Dave Peterson

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,565
Default Textbox data to cell

Assuming the text boxes are numbered in the same order that you listed them,
you could:

Private Sub UserForm_Click()
ActiveSheet.Range("A1") = Me.TextBox2,Value & "," & _
Me.TextBox1.Value & "-" & Me.TextBox3.Value
End Sub

But I would seriously consider putting the employee number in a separate
column for sorting, searching, etc. at a later date if needed.



"Pats" wrote in message
...
My userform has a TextBox for First Name , Last Name and Employee #. What
I
need to know is, how can I put the contents of all 3 Textboxes into one
cell?

Example:

Last Name, First Name - Employee #



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Textbox data to cell

I don't understand the difference.

Do you not like variables or do you not like qualifying the ranges?

FSt1 wrote:

hi
this should do it. adjust ranges to suit.
Range("C5").Value = _
Me.TextBox2.Value & ", " & Me.TextBox1.Value & " - " & Me.TextBox3.Value

regards
FSt1

"Dave Peterson" wrote:

Dim SomeCell as range

Set somecell = activesheet.range("a1")
somecell.value _
= me.textbox2.value & ", " & me.textbox1.value & " - " & me.textbox3.value



Pats wrote:

My userform has a TextBox for First Name , Last Name and Employee #. What I
need to know is, how can I put the contents of all 3 Textboxes into one cell?

Example:

Last Name, First Name - Employee #


--

Dave Peterson


--

Dave Peterson
  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,942
Default Textbox data to cell

hi
opps. posted under the wrong post.
i read the op's request. i have a play form where i test stuff before
posting. when i came back, you had already posted with almost the same thing
i had. i had already did the work so i thought i would just toss in my 2
cents any way. but posted under your post instead of the op's. sorry. my bad.

Regards
FSt1

"Dave Peterson" wrote:

I don't understand the difference.

Do you not like variables or do you not like qualifying the ranges?

FSt1 wrote:

hi
this should do it. adjust ranges to suit.
Range("C5").Value = _
Me.TextBox2.Value & ", " & Me.TextBox1.Value & " - " & Me.TextBox3.Value

regards
FSt1

"Dave Peterson" wrote:

Dim SomeCell as range

Set somecell = activesheet.range("a1")
somecell.value _
= me.textbox2.value & ", " & me.textbox1.value & " - " & me.textbox3.value



Pats wrote:

My userform has a TextBox for First Name , Last Name and Employee #. What I
need to know is, how can I put the contents of all 3 Textboxes into one cell?

Example:

Last Name, First Name - Employee #

--

Dave Peterson


--

Dave Peterson



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Textbox data to cell

Ah.

No problem. I am no longer confused--well, about that <vbg.

FSt1 wrote:

hi
opps. posted under the wrong post.
i read the op's request. i have a play form where i test stuff before
posting. when i came back, you had already posted with almost the same thing
i had. i had already did the work so i thought i would just toss in my 2
cents any way. but posted under your post instead of the op's. sorry. my bad.

Regards
FSt1

"Dave Peterson" wrote:

I don't understand the difference.

Do you not like variables or do you not like qualifying the ranges?

FSt1 wrote:

hi
this should do it. adjust ranges to suit.
Range("C5").Value = _
Me.TextBox2.Value & ", " & Me.TextBox1.Value & " - " & Me.TextBox3.Value

regards
FSt1

"Dave Peterson" wrote:

Dim SomeCell as range

Set somecell = activesheet.range("a1")
somecell.value _
= me.textbox2.value & ", " & me.textbox1.value & " - " & me.textbox3.value



Pats wrote:

My userform has a TextBox for First Name , Last Name and Employee #. What I
need to know is, how can I put the contents of all 3 Textboxes into one cell?

Example:

Last Name, First Name - Employee #

--

Dave Peterson


--

Dave Peterson


--

Dave Peterson
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How can i import data from a cell in another sheet, into a textbox Hans the norwegian Excel Worksheet Functions 1 August 19th 09 01:39 PM
Textbox data to cell Dave Peterson Excel Programming 0 June 11th 09 11:58 PM
Load ws cell data into a textbox via click on chart datapoint a Charts and Charting in Excel 4 January 23rd 09 08:08 PM
Copy Textbox data to Textbox in Other File Troubled User Excel Programming 2 October 6th 08 06:42 PM
Copy excel data (inc. textbox data) into Word Sarah (OGI) Excel Discussion (Misc queries) 0 August 14th 07 05:00 PM


All times are GMT +1. The time now is 10:49 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"