Copy & Paste from a User Form VBA

Status
This thread has been Locked and is not open to further replies. Please start a New Thread if you're having a similar issue. View our Welcome Guide to learn how to use this site.

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.
 

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.
 
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
 
Status
This thread has been Locked and is not open to further replies. Please start a New Thread if you're having a similar issue. View our Welcome Guide to learn how to use this site.

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

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 807,865 other people just like you!

Latest posts

Staff online

Top