Data Copy from Userform to Multiple Cells

KRKComputers

New Member
Joined
Nov 10, 2017
Messages
43
Hello,

I have the following code attached below that I have created and would like to copy the data that is input into the UserForm into multiple cells. For example lets say I have a textbox called TXTBX_Meals and I enter a Value of $12.00 I would like to populate the cell that is designated for this say "A4" and I also want to populate a second cell at the same time say Cell "A6" with the same value. How can I accomplish this copy of one entry into two cells at the same time? I have tried a few items with no success and would greatly appreciate if someone can point me in the correct path.

Thanks in advance
Kevin

CODE BELOW:

Code:
Private Sub SAVEBUTTON_Click()If TXTBX_MEALS.Text = "" Then
    'MsgBox ("Please Enter a Value!")
        Else
    Range("K9").Value = TXTBX_MEALS.Text
    End If
If TXTBX_GAS.Text = "" Then
    'MsgBox ("Please Enter a Value!")
        Else
    Range("K10").Value = TXTBX_GAS.Text
    End If
If TXTBX_OFC_SUP.Text = "" Then
    'MsgBox ("Please Enter a Value!")
        Else
    Range("K11").Value = TXTBX_OFC_SUP.Text
    End If
If TXTBX_SHP_SUP.Text = "" Then
    'MsgBox ("Please Enter a Value!")
        Else
    Range("K12").Value = TXTBX_SHP_SUP.Text
    End If
If TXTBX_GEN_EXP.Text = "" Then
    'MsgBox ("Please Enter a Value!")
        Else
    Range("K13").Value = TXTBX_GEN_EXP.Text
    End If
If TXTBX_WRHS_SUP.Text = "" Then
    'MsgBox ("Please Enter a Value!")
        Else
    Range("K14").Value = TXTBX_WRHS_SUP.Text
    End If
If TXTBX_CASH_DRAW.Text = "" Then
    'MsgBox ("Please Enter a Value!")
        Else
    Range("K15").Value = TXTBX_CASH_DRAW.Text
    End If
If TXTBX_CAS_LAB.Text = "" Then
    'MsgBox ("Please Enter a Value!")
        Else
    Range("K16").Value = TXTBX_CAS_LAB.Text
    End If
If TXTBX_SHOP_UNI.Text = "" Then
    'MsgBox ("Please Enter a Value!")
        Else
    Range("K17").Value = TXTBX_SHOP_UNI.Text
    End If
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"
Re: Data Copy from Userform to Mutiple Cells

Try

Code:
Private Sub SAVEBUTTON_Click()
If TXTBX_MEALS.Text = "" Then
    'MsgBox ("Please Enter a Value!")
        Else
    Range("K9").Value = TXTBX_MEALS.Text
    Range("[COLOR=#0000ff]L9[/COLOR]").Value = TXTBX_MEALS.Text
    End If

'...continue your code
 
Upvote 0
Re: Data Copy from Userform to Mutiple Cells

Dante,

Thanks for the response. Tested and is working as needed. I greatly appreciate your help.

Have a great Weekend :)

Best Regards
Kevin



Try

Code:
Private Sub SAVEBUTTON_Click()
If TXTBX_MEALS.Text = "" Then
    'MsgBox ("Please Enter a Value!")
        Else
    Range("K9").Value = TXTBX_MEALS.Text
    Range("[COLOR=#0000ff]L9[/COLOR]").Value = TXTBX_MEALS.Text
    End If

'...continue your code
 
Upvote 0
Re: Data Copy from Userform to Mutiple Cells

Dante,

Thanks for the response. Tested and is working as needed. I greatly appreciate your help.

Have a great Weekend :)

Best Regards
Kevin

I'm glad to help you. Thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,214,643
Messages
6,120,702
Members
448,980
Latest member
CarlosWin

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