How do i make a variable to a parameter

Lino

Active Member
Joined
Feb 27, 2002
Messages
429
I am looping through a file with a for each statement and then in the for loop statement i am comparing the value of the cell with tickers to the for each loop ticker value and if the same i assign the value of the shares for the ticker to the totshares variable with the parameter of the Ticker in question.

then later on down the code when i reference TotShare(ThisTicker) I will be able to see how many shares for each specific ticker.

How do I set this up so TotShares will take a parameter.

Thanks Lino

For Each NewTicker In Range("C1:C" & Range("C65536").End(xlUp).Row)
ThisTicker = NewTicker.Value

For i = 1 To FinalRow
If Cells(i, 3) = ThisTicker And (Action = "B" Or Action = "BL") Then
TotShares(ThisTicker) = TotShares + Cells(i, 2)
End If
Next i
 
where do i look to see if this: Microsoft Jet 4.0 OLE DB Provider is installed?

thanks,

lino
 
Upvote 0

Excel Facts

How to total the visible cells?
From the first blank cell below a filtered data set, press Alt+=. Instead of SUM, you will get SUBTOTAL(9,)
See my previous response following: 'Check it out:'

There are detailed, explicit instructions there. :)
 
Upvote 0
and i am saying where is this:

Drill down on Applications -> Microsoft Office Environment -> OLE DB Providers.
 
Upvote 0
i think i figured it out...it your code works if i embed the code in a module in the workbook to be parsed, but if i put the code in an addin called parse.xla it fails...why is that?
 
Upvote 0
Activeworkbook versus Thisworkbook. :) Right here:

Code:
cn.Open "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" & _
    ThisWorkbook.FullName & ";Extended Properties=Excel 8.0;"
 
Upvote 0

Forum statistics

Threads
1,216,071
Messages
6,128,628
Members
449,460
Latest member
jgharbawi

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top