I'm writing a project that ultimately does a huge chunk of electrical engineering work automatically, and I've hit a wall with this one process.
I'm trying to search through this table of values: http://www.houwire.com/products/technical/article310_16.html
This is the NEC reference table to determine if a wire is large enough to handle the current going through it.
My script is suppose to grab the current value from a list and read the table column associated with the wire I will be using. An example of this is:
Copper Cable
Max Amperage: 194
Cable Temp: 90C
So I would read through column for 90C in Copper, and I'd find 195. Since 195 is the next highest value in the table for my wire, I'd select that. However, my problem doesn't stop here, This value isn't going to be the one I use. I need to use this value to help do a bunch of site specific checks, and eventually I'll settle on a number of 260.
Once I have this number, I need to cross reference that number to the AWG size on the far right, in this case it's 4/0.
Hopefully that explanation isn't too messy. My current approach is to find 195 and get the address. Then while I go through my conditional checks, I use offset to adjust which cable I have selected.
The code I tried to use this:
TempDataColumn is a range that defines my 90C column, amp_max is the calculated amperage I need to match against. The code is throwing a mismatch, which I believe is because Match returns a number and not a range. Is there a way to make this return a range or a different function that can do this search?
I'm trying to search through this table of values: http://www.houwire.com/products/technical/article310_16.html
This is the NEC reference table to determine if a wire is large enough to handle the current going through it.
My script is suppose to grab the current value from a list and read the table column associated with the wire I will be using. An example of this is:
Copper Cable
Max Amperage: 194
Cable Temp: 90C
So I would read through column for 90C in Copper, and I'd find 195. Since 195 is the next highest value in the table for my wire, I'd select that. However, my problem doesn't stop here, This value isn't going to be the one I use. I need to use this value to help do a bunch of site specific checks, and eventually I'll settle on a number of 260.
Once I have this number, I need to cross reference that number to the AWG size on the far right, in this case it's 4/0.
Hopefully that explanation isn't too messy. My current approach is to find 195 and get the address. Then while I go through my conditional checks, I use offset to adjust which cable I have selected.
The code I tried to use this:
Code:
Dim WireAmpLoc As Range
Set WireAmpLoc = WorksheetFunction.Match(amp_max, ActiveWorksheet.Range("TempDataColumn"), -1)
TempDataColumn is a range that defines my 90C column, amp_max is the calculated amperage I need to match against. The code is throwing a mismatch, which I believe is because Match returns a number and not a range. Is there a way to make this return a range or a different function that can do this search?