wabbit_47
New Member
- Joined
- Feb 9, 2012
- Messages
- 12
Hi Excel Gurus 
Like many, I'm a bit of a VBA/Macro 'Noob' but I'm hoping there might be someone out there with an 'elegant' solution to this problem for me...
I've been developing a large spreadsheet (approx 26 columns) and ongoing/infinite rows. Each row entry is filled in by a userform and entered by hitting the 'Submit' button which pastes everything from the forms textboxes, comboboxes, DTPickers, etc into the corresponding columns automatically and all is working ticketty-boo except for 3 of the columns, all with the same problem.
The troublesome three are all entered into the sheet via a textbox on the userform just like the others, only they all contain large quantities of text. I'm trying to figure out a way of displaying this text in the actual cell (after submitting the form) without altering the row height (keeping it all to an 'elegant' 15.00), but still maintaining the ability to search for text in the cells....perhaps some kind of 'hover-over' display or the like?
The macro to paste the information into the spreadsheet is triggered by a submit button on the userform that is coded as below...
Textboxes 8, 22 and 23 are the ones with multiple lines. The code that starts with "Replace(FutureMovementsForm...." is to prevent the square boxes with the question marks appearing in the cells.
Long-winded but hopefully detailed and specific enough that you might have a few possible solutions
Cheers to you in advance
Wabbit_47

Like many, I'm a bit of a VBA/Macro 'Noob' but I'm hoping there might be someone out there with an 'elegant' solution to this problem for me...
I've been developing a large spreadsheet (approx 26 columns) and ongoing/infinite rows. Each row entry is filled in by a userform and entered by hitting the 'Submit' button which pastes everything from the forms textboxes, comboboxes, DTPickers, etc into the corresponding columns automatically and all is working ticketty-boo except for 3 of the columns, all with the same problem.
The troublesome three are all entered into the sheet via a textbox on the userform just like the others, only they all contain large quantities of text. I'm trying to figure out a way of displaying this text in the actual cell (after submitting the form) without altering the row height (keeping it all to an 'elegant' 15.00), but still maintaining the ability to search for text in the cells....perhaps some kind of 'hover-over' display or the like?
The macro to paste the information into the spreadsheet is triggered by a submit button on the userform that is coded as below...
Code:
Private Sub CommandButton1_Click()
Dim LastRow As Object
Set LastRow = Sheet1.Range("a65536").End(xlUp)
LastRow.Offset(1, 0).Value = DTPicker1.Value
LastRow.Offset(1, 1).Value = DTPicker2.Value
LastRow.Offset(1, 2).Value = TextBox3.Text
LastRow.Offset(1, 3).Value = TextBox4.Text
LastRow.Offset(1, 4).Value = TextBox5.Text
LastRow.Offset(1, 5).Value = ComboBox7.Text
LastRow.Offset(1, 6).Value = DTPicker3.Value
LastRow.Offset(1, 7).Value = TextBox6.Text
LastRow.Offset(1, 8).Value = TextBox7.Text
LastRow.Offset(1, 9).Value = Replace(FutureMovementsForm.TextBox8.Text, vbCrLf, vbLf, 1, -1, vbTextCompare)
Me.Hide
LastRow.Offset(1, 10).Value = TextBox9.Text
LastRow.Offset(1, 11).Value = TextBox10.Text
LastRow.Offset(1, 12).Value = TextBox11.Text
LastRow.Offset(1, 13).Value = TextBox12.Text
LastRow.Offset(1, 14).Value = TextBox13.Text
LastRow.Offset(1, 15).Value = TextBox14.Text
LastRow.Offset(1, 16).Value = ComboBox1.Text
LastRow.Offset(1, 17).Value = TextBox16.Text
LastRow.Offset(1, 18).Value = ComboBox2.Text
LastRow.Offset(1, 19).Value = ComboBox3.Text
LastRow.Offset(1, 20).Value = ComboBox4.Text
LastRow.Offset(1, 21).Value = ComboBox5.Text
LastRow.Offset(1, 22).Value = ComboBox6.Text
LastRow.Offset(1, 23).Value = Replace(FutureMovementsForm.TextBox22.Text, vbCrLf, vbLf, 1, -1, vbTextCompare)
Me.Hide
LastRow.Offset(1, 24).Value = Replace(FutureMovementsForm.TextBox23.Text, vbCrLf, vbLf, 1, -1, vbTextCompare)
Me.Hide
MsgBox "One record written to the shedule"
response = MsgBox("Do you want to enter another record?", _
vbYesNo)
If response = vbYes Then
TextBox3.Text = ""
TextBox4.Text = ""
TextBox5.Text = ""
TextBox6.Text = ""
TextBox7.Text = ""
TextBox8.Text = ""
TextBox9.Text = ""
TextBox10.Text = ""
TextBox11.Text = ""
TextBox12.Text = ""
TextBox13.Text = ""
TextBox14.Text = ""
TextBox16.Text = ""
TextBox22.Text = ""
TextBox23.Text = ""
ComboBox1.Text = ""
ComboBox2.Text = ""
ComboBox3.Text = ""
ComboBox4.Text = ""
ComboBox5.Text = ""
ComboBox6.Text = ""
ComboBox7.Text = ""
DTPicker1.SetFocus
Else
Unload Me
End If
End Sub
Textboxes 8, 22 and 23 are the ones with multiple lines. The code that starts with "Replace(FutureMovementsForm...." is to prevent the square boxes with the question marks appearing in the cells.
Long-winded but hopefully detailed and specific enough that you might have a few possible solutions

Cheers to you in advance

Wabbit_47