
Originally Posted by
mcbrocks
all except for the first cells property: Cells(10, Column). It's showing the correct column, but the value of this cell, is from my active sheet and not the referenced sheet, meaning: It shows: Worksheets(DataPVC2) <--in the pop up box. BUT the cell displays the value from Worksheets(DataThermo2) <-- or whatever worksheet is active.
I think you've nailed it - and I should have seen this - the range is not properly qualified; the Cells(…) parts need to be qualified:
Code:
With Worksheets(WorksheetName)
VoltageDrop = WorksheetFunction.VLookup(Val(LoadCurrentText.Text), .Range(.Cells(10, Column), .Cells(26, VoltageDropColumn)), ReturnColumn)
End With
paying especial attention to the dots in the code. The With… End With consruct could probably span more than one line.
Bookmarks