?
Solved

Transfer data from a VBA userform to an Excel spreadsheet

Posted on 2003-03-31
4
Medium Priority
?
721 Views
Last Modified: 2010-05-18
Hey,
I am trying to make the data that will be inserted in my userform automatically gets stored into designated cells in my excel spreadsheet so that the user can have records that can be retrieved later. My main problem is finding the correct codes that allow the data i enter to be plugged in the desired sheet.
thank you

Emad
0
Comment
Question by:stamad
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
4 Comments
 

Accepted Solution

by:
sharjilsalem earned 300 total points
ID: 8241149
The syntax for refrencing a particular cell in an excel worksheet using VBA is

Worksheets("SheetName").Cells(Row,Column).Value

In the above command, u will have to use the RC format for refrencing a particular cell n not the default A1 format. for example if u want to refrence the cell B2, so this will be refrenced as (2,2), ie; 2nd row 2nd column. similarly D5 will be refrenced as (5,4).

Now, assuming u are receiving data from the user in a textbox named Text1 and the name of the worksheet into which u want to enter the data is Sheet1, and the cell into which the data has to be entered is B10, then the following syntax will be used

Worksheets("Sheet1").Cells(10,2).Value = Text1.Text

Hope this answers ur question.
0
 

Expert Comment

by:alfD
ID: 8244663
One further point:
If you want the data to go to the worksheet immediately you change the textbox, you could use Text1_Change to trigger the transfer. Or you could leave it until you exit the form, if, say, you have a number of changes to make.
0
 

Expert Comment

by:CleanupPing
ID: 9446626
stamad:
This old question needs to be finalized -- accept an answer, split points, or get a refund.  For information on your options, please click here-> http:/help/closing.jsp#1 
EXPERTS:
Post your closing recommendations!  No comment means you don't care.
0

Featured Post

Get 15 Days FREE Full-Featured Trial

Benefit from a mission critical IT monitoring with Monitis Premium or get it FREE for your entry level monitoring needs.
-Over 200,000 users
-More than 300,000 websites monitored
-Used in 197 countries
-Recommended by 98% of users

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this post we will learn how to make Android Gesture Tutorial and give different functionality whenever a user Touch or Scroll android screen.
Make the most of your online learning experience.
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …
Introduction to Processes

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question