Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Load data from Excel to VBA

Posted on 2014-10-31
4
Medium Priority
?
196 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 1500 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 49

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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

Whether you've completed a degree in computer sciences or you're a self-taught programmer, writing your first lines of code in the real world is always a challenge. Here are some of the most common pitfalls for new programmers.
In Part II of this series, I will discuss how to identify all open instances of Excel and enumerate the workbooks, spreadsheets, and named ranges within each of those instances.
This Micro Tutorial will demonstrate in Microsoft Excel how to add style and sexy appeal to horizontal bar charts.
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…

670 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