1. Computer problem? Tech Support Guy is completely free -- paid for by advertisers and donations. Click here to join today! If you're new to Tech Support Guy, we highly recommend that you visit our Guide for New Members.

Copy & Paste from a User Form VBA

Discussion in 'Software Development' started by exceled, Jun 18, 2007.

Thread Status:
Not open for further replies.
  1. exceled

    exceled Thread Starter

    Joined:
    Jun 12, 2007
    Messages:
    8
    I created a User form in excel 2003, with a Text box and command button. When the form runs I want to enter text into the text box and when I press the command button, I want the text to be copied to an Excel spreedsheet cell.
     
  2. OBP

    OBP

    Joined:
    Mar 8, 2005
    Messages:
    19,895
    You would be better off posting this question on the Business Applications Forum, that is where the "Excel" guys answer Excel questions.
     
  3. Rollin_Again

    Rollin_Again

    Joined:
    Sep 4, 2003
    Messages:
    4,912
    In the form's design view just double click the command button and the button_click sub will open. Just add your code there. Just replace Sheet1 with your actual sheetname, replace A1 with your actual cell, replace Form1 with your actual form name, replace Textbox1 with the actual name of your textbox.

    Code:
    Sheets("Sheet1").Range("A1").Value = Form1.Textbox1.Text
    Cheers,
    Rollin
     
As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 733,556 other people just like you!

Thread Status:
Not open for further replies.

Short URL to this thread: https://techguy.org/585404

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice