Results 1 to 4 of 4

Thread: Data Copy from Userform to Multiple Cells
Thanks Thanks: 0 Likes Likes: 0

  1. #1
    New Member
    Join Date
    Nov 2017
    Location
    Toronto
    Posts
    43
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Data Copy from Userform to Multiple Cells

    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

  2. #2
    Board Regular DanteAmor's Avatar
    Join Date
    Dec 2018
    Location
    México
    Posts
    6,240
    Post Thanks / Like
    Mentioned
    71 Post(s)
    Tagged
    14 Thread(s)

    Default 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("L9").Value = TXTBX_MEALS.Text
        End If
    
    '...continue your code
    Regards Dante Amor

  3. #3
    New Member
    Join Date
    Nov 2017
    Location
    Toronto
    Posts
    43
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default 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



    Quote Originally Posted by DanteAmor View Post
    Try

    Code:
    Private Sub SAVEBUTTON_Click()
    If TXTBX_MEALS.Text = "" Then
        'MsgBox ("Please Enter a Value!")
            Else
        Range("K9").Value = TXTBX_MEALS.Text
        Range("L9").Value = TXTBX_MEALS.Text
        End If
    
    '...continue your code

  4. #4
    Board Regular DanteAmor's Avatar
    Join Date
    Dec 2018
    Location
    México
    Posts
    6,240
    Post Thanks / Like
    Mentioned
    71 Post(s)
    Tagged
    14 Thread(s)

    Default Re: Data Copy from Userform to Mutiple Cells

    Quote Originally Posted by KRKComputers View Post
    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.
    Regards Dante Amor

Some videos you may like

User Tag List

Tags for this Thread

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •