Results 1 to 6 of 6

Move data from userform to worksheet textbox

This is a discussion on Move data from userform to worksheet textbox within the Excel Questions forums, part of the Question Forums category; I'm still trying to figure out how to move data from a textbox in a userform to a textbox on ...

  1. #1
    Board Regular
    Join Date
    Sep 2002
    Location
    Chicago, Il
    Posts
    63

    Default Move data from userform to worksheet textbox

    I'm still trying to figure out how to move data from a textbox in a userform to a textbox on the worksheet (created from picture toolbar). I manually recorded the following macro to see what code excel wanted. I've put this into my userform code and it runs without errors. Problem is, the textbox remains empty.


    Private Sub CommandButton2_Click()
    MsgBox ("Please load letterhead paper into the printer. Press OK when ready.")
    ActiveSheet.Shapes("Text Box 239").Select
    Selection.Characters.Text = TextBox10.Text
    End Sub
    Rich Szczypkowski

  2. #2
    Board Regular
    Join Date
    Sep 2002
    Location
    Chicago, Il
    Posts
    63

    Default

    I guess I've stumped everybody.
    Rich Szczypkowski

  3. #3
    Board Regular
    Join Date
    Sep 2002
    Location
    Chicago, Il
    Posts
    63

    Default

    Should I be looking for an alternative to this method? I'm trying this because the data exceeds excels cell display capabilities. If I dump the data into a cell (which works fine) not all of the characters are displayed. It was suggested that I try utilizing a textbox instead of a cell.

    Rich Szczypkowski

  4. #4
    AJ
    AJ is offline
    Board Regular
    Join Date
    Mar 2002
    Location
    =ActiveCell.Address
    Posts
    478

    Default

    Hi Rich

    I might be missing something but I've just tried the code you posted and it worked.
    Can you just check that your text box on the form is indeed Textbox10 and that the one on the sheet is really Text Box 239.

    Or is there any more info you can give us?

    Ta
    AJ

  5. #5
    Board Regular
    Join Date
    Sep 2002
    Location
    Chicago, Il
    Posts
    63

    Default

    thanks for the reply. Yes, I've verified all of the information is correct. When you tested it were you transferring from a userbox textbox to a worksheet item?

    I can't figure out myself why the box stays empty.

    Rich
    Rich Szczypkowski

  6. #6
    Board Regular
    Join Date
    Feb 2002
    Posts
    384

    Default

    rszczypk, I tried your code as well using a userform textbox to transfer data to a worksheet textbox and it worked. You made mention of creating the textbox on your worksheet from the Picture toolbar.

    a textbox on the worksheet (created from picture toolbar)
    I created my textbox using the drawing toolbar, I wonder if this could be the hold up. Regards, Marc

    PS. I'm not sure about this but, perhaps it's also necessary to make a reference to the "Microsoft Excel Object Library" in your VB editor. Go to TOOLS/References and look for it, check it and select OK. HTH

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
  •  


DMCA.com