Message 1 of 18
Finding Values in an array
Not applicable
05-26-2016
02:22 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Greetings. The following code works great inside the Excel VBA envirnoment.
I would like to transfer this over to Inventor so that when I run I can go and grab the excel info and use it.
The end result in Inventor would be for the parameters to be equal to the cell values found.
of course a second option could be if I could figure out how to store the values then only pull those values from Excel into Inventor.
Question1 - Is this even possible?
Comment1 - if it is, please help!
Currently the only real issue I am having is to figure out the equivilant find and find next method in Inventor. I assume there is a way to search through an arrray and keep only the values that match.
Thanks
Option Explicit
Sub FindEvap()
Dim SearchRange As Range
Dim ADTevap As Range
Dim FirstADTevapCell As String
Dim ADTQTY As Integer
Set SearchRange = Range("A1:A10")
Dim ADTdesign(7) As String
Set ADTevap = SearchRange.Find("adt")
If ADTevap Is Nothing Then
ADTQTY = 0
Else
FirstADTevapCell = ADTevap.Address
Do
ADTevap.Select
Set ADTevap = SearchRange.FindNext(ADTevap)
ADTQTY = ADTQTY + 1
ADTdesign(ADTQTY - 1) = ADTevap.Value
Loop While ADTevap.Address <> FirstADTevapCell
End If
'numberofevap = ADTQTY
'ADTModel1 = ADTdesign(0)
'ADTModel2 = ADTdesign(1)
'ADTModel3 = ADTdesign(2)
'ADTModel4 = ADTdesign(3)
'ADTModel5 = ADTdesign(4)
'ADTModel6 = ADTdesign(5)
'ADTModel7 = ADTdesign(6)
'ADTModel8 = ADTdesign(7)
End Sub