Solved

Load data from Excel to VBA

Posted on 2014-10-31
4
187 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
[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 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

Technology Partners: 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

Suggested Solutions

Deploying a Microsoft Access application in a Citrix environment is not difficult but takes a few steps. However, Citrix system people are often of little help, as they typically know next to nothing about Access. The script provided here will take …
You need to know the location of the Office templates folder, so that when you create new templates, they are saved to that location, and thus are available for selection when creating new documents.  The steps to find the Templates folder path are …
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…
Many functions in Excel can make decisions. The most simple of these is the IF function: it returns a value depending on whether a condition you describe is true or false. Once you get the hang of using the IF function, you will find it easier to us…

752 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