Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 67
Default Multiline textbox for data entry

Hi,
I have an Excel database with data entry form that contain a multiline
textbox. my problem is that the multiline information in the textbox (up to
15 lines) is copied into one multiline cell in the list, and i want the
information of each line to be stored in a separated cell and row, so a 15
lines in the textbox will be stored as 15 cells.

Thanks in advance

Eli
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,391
Default Multiline textbox for data entry

Eli,
Depending on what you want to happen if there are not 15 lines of text
(either more or less):

Private Sub CommandButton1_Click()
Dim TempStr() As String

TextBox1.Text = "Line 1" & vbNewLine & "Line 2" & vbNewLine & "Line 3" &
vbNewLine & "Line 4" & vbNewLine & "Line 5"

TempStr = Split(TextBox1.Text, vbNewLine)

Range("A1").Resize(15).Value = Application.Transpose(TempStr)
'Or
Range("A1").Resize(UBound(TempStr) + 1).Value =
Application.Transpose(TempStr)

End Sub

NickHK

"???" wrote in message
...
Hi,
I have an Excel database with data entry form that contain a multiline
textbox. my problem is that the multiline information in the textbox (up

to
15 lines) is copied into one multiline cell in the list, and i want the
information of each line to be stored in a separated cell and row, so a 15
lines in the textbox will be stored as 15 cells.

Thanks in advance

Eli



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 67
Default Multiline textbox for data entry

Thanks very much!!!

Eli

"NickHK" wrote:

Eli,
Depending on what you want to happen if there are not 15 lines of text
(either more or less):

Private Sub CommandButton1_Click()
Dim TempStr() As String

TextBox1.Text = "Line 1" & vbNewLine & "Line 2" & vbNewLine & "Line 3" &
vbNewLine & "Line 4" & vbNewLine & "Line 5"

TempStr = Split(TextBox1.Text, vbNewLine)

Range("A1").Resize(15).Value = Application.Transpose(TempStr)
'Or
Range("A1").Resize(UBound(TempStr) + 1).Value =
Application.Transpose(TempStr)

End Sub

NickHK

"???" wrote in message
...
Hi,
I have an Excel database with data entry form that contain a multiline
textbox. my problem is that the multiline information in the textbox (up

to
15 lines) is copied into one multiline cell in the list, and i want the
information of each line to be stored in a separated cell and row, so a 15
lines in the textbox will be stored as 15 cells.

Thanks in advance

Eli




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
Textbox and multiline text Mats Samson Excel Worksheet Functions 0 September 18th 07 08:18 PM
User Form: Multiline textbox to multiple rows Newbike Excel Programming 0 November 8th 06 04:56 PM
Userform Textbox multiline Vs format in worksheet Jim May Excel Programming 4 October 16th 05 10:15 PM
UserForm; Textbox; Multiline; NonPrintable Characters sa3214[_2_] Excel Programming 3 November 3rd 04 03:46 PM
Multiline textbox.. Can you have multiple font colors within? bdcrisp[_14_] Excel Programming 3 December 12th 03 12:51 PM


All times are GMT +1. The time now is 09:16 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"