Copy Form Fields To Insert As Two Cells

  • Hi,
    Is there a way to copy data from one form text field so that it will be pasted into two cells? (this paste will ultimately go into a different, non MS, application.)


    I tried i.e. chr(10) when the data is filled into the form but that is unsuccessful. Is there a "special character" that would result in the pasted data to be read as two cells?


    The data in the form field is usually 6-digits (numbers), a dash and then 1 or two more digits (numbers), i.e. 123456 - 1 or 987654 - 12. We coudl omit the dash and enter any sort of divider though.


    Or...
    Do you know of an option that would allow to copy two form text fields at one time to achive the above?


    Stefan

  • Re: Copy Form Fields To Insert As Two Cells


    StefanG,


    Can't really tell what you want.


    Do you want:
    Take the input from the form field and put part of it into one cell and the other part into another cell?


    Take the input from the form field and put the same thing into two different cells?


    Also, what kind of form? [Data][Form...] from the Excel menu? A user form you created from the Control Toolbox menu? From the Forms menu?


    Jim

  • Re: Copy Form Fields To Insert As Two Cells


    Hi,
    Sorry, not my day to be clear i suppose, my apologies.


    I have a UserForm with two TextBoxes.
    Textbox1 and Textbox2 are next to each other on the UserForm and contain data from Sheet1 cells A1 and E1.
    The data is filled in upon activating the UserForm...

    Code
    Private Sub UserForm_Activate()
    TextBox1.Text = Range("Num1")
    TextBox2.Text = Range("Qty1")
    ...


    One of the tasks is to use the data in TextBox1 and TextBox2 in another application.


    I can copy TextBox1 by itself and then TextBox2; i would like to be able to copy both at once.


    If i combine that data that is now TextBox1 and TextBox2 into one TextBox I could ... like so,

    Code
    TextBox1.Text = Range("Num1") & Range("Qty1")

    but I dont know what "divider" to use so that the copied data behaves as if I copy two cells in a Worksheet.


    Say I copy A1 and B1. Copying cells like that allows pasting both at the same time into the other location/application.


    I hope this makes more sense with the appropriate terminology.
    Stefan

  • Re: Copy Form Fields To Insert As Two Cells


    Stefan


    I'm afraid it still isn't clear what you mean.


    What's the other application?


    What do you mean by 'the copied data behaves as if I copy two cells in a Worksheet.'?

    Boo!:yikes:

  • Re: Copy Form Fields To Insert As Two Cells


    Hi Nori,
    The application is SAP.


    When you select and copy A1 and B1
    A1 = ValueA1
    B1 = ValueB1
    then select E3 and paste, the data will paste into E3 and F3.
    E3 = ValueA1
    F3 = ValueB1


    When you select and copy TextBox1 (which holds the data from A1 & B1)
    TextBox1 = ValueA1ValueB1
    then select E3 and paste, the data will paste into E3 only.
    E3 = ValueA1ValueB1


    Instead, i want to select and copy TextBox1 (which holds data from A1 & B1)
    TextBox1 = ValueA1ValueB1
    then select E3 and paste, the data will paste into E3 and F3.


    I am wondering how this can be accomplished, i.e. by using a "special character" between the ValueA1 and ValueB1 in TextBox1. Apparently you cannot copy two TextBoxes at one time... or can you?


    I'm sure this is clear as mud.
    Thank you for your patience and trying to help.


    Stefan

  • Re: Copy Form Fields To Insert As Two Cells


    There is no special character that you can put in the combination of values that tells Excel to split them apart when pasted. Why not just copy and paste the two separately?

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!