Switch To Uppercase before Inserting Into Table

Yuriy B

New Member
Joined
Feb 4, 2015
Messages
26
Hi,

I have created a userform with text fields, and it dumps this data into a table.
Is it possible to convert everything to UpperCase before the data gets transferred over?

Code:
Private Sub ENTER_Click()


If TextBox1.Value = "" Or TextBox4.Value = "" Or TextBox5.Value = "" Or TextBox6.Value = "" Or TextBox7.Value = "" Or TextBox8.Value = "" Or TextBox9.Value = "" Or TextBox10.Value = "" Or TextBox11.Value = "" Or TextBox12.Value = "" Or TextBox13.Value = "" Or TextBox14.Value = "" Or TextBox15.Value = "" Or ComboBox1.Value = "" Or ComboBox2.Value = "" Or ComboBox3.Value = "" Then
    If MsgBox("Form is not complete. Do you want to continue?", vbQuestion + vbYesNo) <> vbYes Then
    Exit Sub
    End If
End If


Dim the_Sheet As Worksheet
Dim the_Table As ListObject
Dim Table_Object As ListRow
Set the_Sheet = Sheets("All")
Set the_Table = the_Sheet.ListObjects(1)
Set Table_Object = the_Table.ListRows.Add


Table_Object.Range(1, 1).Value = TextBox1.Value     *Switch to UpperCase

Table_Object.Range(1, 2).Value = TextBox4.Value     *Switch to UpperCase
Table_Object.Range(1, 3).Value = TextBox5.Value
Table_Object.Range(1, 4).Value = TextBox6.Value
Table_Object.Range(1, 11).Value = TextBox7.Value
Table_Object.Range(1, 16).Value = TextBox8.Value
Table_Object.Range(1, 17).Value = TextBox9.Value
Table_Object.Range(1, 18).Value = TextBox10.Value
Table_Object.Range(1, 19).Value = TextBox11.Value
Table_Object.Range(1, 5).Value = TextBox12.Value
Table_Object.Range(1, 6).Value = TextBox13.Value
Table_Object.Range(1, 7).Value = TextBox14.Value
Table_Object.Range(1, 9).Value = TextBox15.Value
Table_Object.Range(1, 8).Value = ComboBox1.Value
Table_Object.Range(1, 10).Value = ComboBox2.Value
Table_Object.Range(1, 15).Value = ComboBox3.Value
Table_Object.Range(1, 13).Value = "25.00"


Call resetForm


End Sub


Sub resetForm()


TextBox1.Value = ""
TextBox4.Value = ""
TextBox5.Value = ""
TextBox6.Value = ""
TextBox7.Value = ""
TextBox8.Value = ""
TextBox9.Value = ""
TextBox10.Value = ""
TextBox11.Value = ""
TextBox12.Value = ""
TextBox13.Value = ""
TextBox14.Value = ""
TextBox15.Value = ""
ComboBox1.Value = ""
ComboBox2.Value = ""
ComboBox3.Value = ""
UserForm1.TextBox1.SetFocus


End Sub

Thanks!
 

Excel Facts

Will the fill handle fill 1, 2, 3?
Yes! Type 1 in a cell. Hold down Ctrl while you drag the fill handle.
Try
Code:
UCase(TextBox1.Value)
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,177
Members
453,021
Latest member
Justyna P

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top