Solved

Load data from Excel to VBA

Posted on 2014-10-31
4
186 Views
Last Modified: 2014-11-24
I would like to create an excel where users will be entering data and click on "Load"(for example).
Here is what i will do:
-> Read the data from Excel
-> Call Sybase SQLServer Stored procedure for each row passing the cell values as arguments.

I know there is something like ListObject but that is like an Array and we will have to double_loop it to get the row and column values.

do we have any other option like we have DataTable/DataSet in .Net?

Examples would be better
0
Comment
Question by:Ganapathi
4 Comments
 
LVL 5

Accepted Solution

by:
ReneD100 earned 500 total points
ID: 40415182
I'm not sure I understand which part you need help with, but maybe this is a start:
    Dim ws As Worksheet
    Dim rTotal, rRow As Excel.Range
    
    Set ws = Worksheets(1)
    Set rTotal = ws.UsedRange
    For Each rRow In rTotal
        'you probably want to do some checking here for valid data
        'and you can build your parameter list based on cell value
        With rRow
            'replace with required parameters and your call to Sybase
            MsgBox rRow.Cells(1, 1) & rRow.Cells(1, 2)
        End With
    Next

Open in new window

0
 
LVL 47

Expert Comment

by:Martin Liss
ID: 40462118
I've requested that this question be deleted for the following reason:

Not enough information to confirm an answer.
0
 
LVL 8

Author Closing Comment

by:Ganapathi
ID: 40462119
Got it. Thank you. Sorry i was out for a while.
0

Featured Post

Secure Your Active Directory - April 20, 2017

Active Directory plays a critical role in your company’s IT infrastructure and keeping it secure in today’s hacker-infested world is a must.
Microsoft published 300+ pages of guidance, but who has the time, money, and resources to implement? Register now to find an easier way.

Question has a verified solution.

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

Freeze panes is an option within all variants of Excel to enable parts of a sheet to remain stationary when the cursor is in another part of the sheet. This is a very useful feature which is overlooked or under used.
Excel can be a tricky bit of software to get your head around. Whilst you’ll be able to eventually get to grips with the basic understanding of how to get by, there are a few Excel tips that not everybody will even know about let alone know how to d…
Graphs within dashboards are meant to be dynamic, representing data from a period of time that will change each time the dashboard is updated with new data. Rather than update each graph to point to a different set within a static set of data, t…
This Micro Tutorial demonstrate the bugs in Microsoft Excel for Mac with Pivot Charts.

685 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