Solved

Load data from Excel to VBA

Posted on 2014-10-31
4
180 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 45

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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Introduction This Article briefly covers methods of calculating the NPV and IRR variants in Excel as well as the limitations in calculating and interpreting IRR results. Paraphrasing Richard Shockley, author of my favourite finance reference tex…
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 …
The viewer will learn how to create a normally distributed random variable in Excel, use a normal distribution to simulate the return on an investment over a period of years, Create a Monte Carlo simulation using a normal random variable, and calcul…
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…

746 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now