Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
What I am trying to do, is call on array and go down it and use these values
for another part of my macro. Everything works fine but this. Here is the code. Option Explicit Private mcnToDatabase As Connection Private mwksResults As Excel.Worksheet Private Const STATE_FIPS_COL = 0 Private Const COMMODITY_COLUMN = 1 Private Const PRACTICE_COL = 2 Private Const CS = "Provider=Microsoft.Jet.OLEDB.4.0;User ID=Admin;Mode=Share Deny None;Jet OLEDB:Engine Type=4;Data Source=" Private Const CLIENT_TAB = "CLIENT" Private Const ALT_TAB = "ALT1" Public Sub Run(dbPath As String) Dim lDataRow As Long Dim lData As Long Dim GetAllData As Variant Dim asData As String ConnectToDatabase dbPath Set GetAllData = asData() 'Stuff in Main that opens Excel For lDataRow = 0 To UBound(asData(0)) Main asData(lDataRow, STATE_FIPS_COL), asData(lData, COMMODITY_COLUMN), asData(lData, PRACTICE_COL) 'RunSolver 'Save as new workbook Next lDataRow End Function It keeps giving me an error and saying "expected array". It says the array isn't there, but it is. It's in the worksheet15. So if anyone can help it would be greatly appreciated. Can someone tweak my code or something? Thanks |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Avg Arrays | Excel Worksheet Functions | |||
Working with ranges in arrays... or an introduction to arrays | Excel Programming | |||
Arrays - declaration, adding values to arrays and calculation | Excel Programming | |||
I need help with arrays (Still) | Excel Programming | |||
Need help with arrays (I think) | Excel Programming |