?
Solved

extract data from excel into vb

Posted on 2003-10-30
4
Medium Priority
?
170 Views
Last Modified: 2010-05-18
Hi,
Can anyone of you experts show me example of coding that extract data in the excel into vb?

I have this excel file that contain few columns (assume to be 3 columns) and rows (assume 10 rows)
I want to extract data in the SECOND column but start at Third row and put the data into a formula that i already write the code in vb. The process repeat for the next row with the same column until it reach the last row ( 10th row). When it reach there, a msgbox will popup.
Also when all this finish, the excel file will close itself and save itself into hard disk (if file already exist, overwrite it).

i think this is simple to you guys. i'm very new to vb (actually never use or learn vb before). So need your help very much. Sound desperate huh!? :)
0
Comment
Question by:michelle_branch
[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
 
LVL 9

Accepted Solution

by:
bhagyesht earned 180 total points
ID: 9656119
take a form
add microsoft excel's reference.
add a command button and the following code
this will help you start with.

Private Sub Command1_Click()
    Dim myapp As New Excel.Application
    Dim myWB As Excel.Workbook
    Dim myWS As Excel.Worksheet
    Set myWB = myapp.Workbooks.Open("c:\myfile.xls")
    myapp.Visible = True
    Set myWS = myWB.Sheets("sheet1")
    MsgBox myWS.Range("A1").Value
    myWB.Save
    Set myWS = Nothing
    myWB.Close
    Set myWB = Nothing
    myapp.Quit
    Set myapp = Nothing
End Sub
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

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.
Computer science students often experience many of the same frustrations when going through their engineering courses. This article presents seven tips I found useful when completing a bachelors and masters degree in computing which I believe may he…
An introduction to basic programming syntax in Java by creating a simple program. Viewers can follow the tutorial as they create their first class in Java. Definitions and explanations about each element are given to help prepare viewers for future …
In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …

801 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