Receiving log Userform adding text before submission

PuntingJawa

Board Regular
Joined
Feb 25, 2021
Messages
140
Office Version
  1. 365
  2. 2019
Platform
  1. Windows
I'm messing with UserForm to make input for receiving and shipping information a little easier. My question is the following. Is there a way for me to have the input generated where for packing slips to show PS before the submission of the packing slip number input.
Example:
I have the following UserForm made up. For Pack No. and PO. I would like to have "PS " and "PO " before the numbers submitted on their lines without having to add PS and PO manually. Is this at all possible?
1650551959597.png


VBA Code:
Private Sub UserForm_Activate()

TextBox1.Text = Format(Now(), "MM/DD/YY")

End Sub
Private Sub CommandButton1_Click()

erow = Sheets("Sheet1").Range("a" & Rows.Count).End(xlUp).Row
    Range("A" & erow + 1) = TextBox1.Value
    Range("B" & erow + 1) = TextBox2.Value
    Range("C" & erow + 1) = TextBox3.Value
    Range("D" & erow + 1) = TextBox4.Value
    Range("E" & erow + 1) = TextBox5.Value
    Range("F" & erow + 1) = TextBox6.Value
    Range("G" & erow + 1) = TextBox7.Value
    Range("I" & erow + 1) = TextBox8.Value
    Range("J" & erow + 1) = TextBox9.Value
    Range("K" & erow + 1) = TextBox10.Value
    Range("L" & erow + 1) = TextBox11.Value
    
    TextBox2.Value = ""
    TextBox3.Value = ""
    TextBox4.Value = ""
    TextBox5.Value = ""
    TextBox6.Value = ""
    TextBox7.Value = ""
    TextBox8.Value = ""
    TextBox9.Value = ""
    TextBox10.Value = ""
    TextBox11.Value = ""

End Sub
 

Excel Facts

Convert text numbers to real numbers
Select a column containing text numbers. Press Alt+D E F to quickly convert text to numbers. Faster than "Convert to Number"
VBA Code:
Range("I" & erow + 1) = "PS " & TextBox8.Value
Range("J" & erow + 1) = "PO " & TextBox9.Value
 
Upvote 0
Solution
That was a lot more simplistic than I thought it would be. Thank you very much!
 
Upvote 0

Forum statistics

Threads
1,215,514
Messages
6,125,272
Members
449,219
Latest member
daynle

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