Solved

Load data from Excel to VBA

Posted on 2014-10-31
4
183 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 46

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

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

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

Workbook link problems after copying tabs to a new workbook? David Miller (dlmille) Intro Have you either copied sheets to a new workbook, and after having saved and opened that workbook, you find that there are links back to the original sou…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
This Micro Tutorial demonstrates how to create Excel charts: column, area, line, bar, and scatter charts. Formatting tips are provided as well.
This Micro Tutorial will demonstrate the scrolling table in Microsoft Excel using the INDEX function.

770 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