BaronVonWasteland
Highest Rated Comments
BaronVonWasteland368 karma
You know what, you're absolutely right. Although they both do the same thing, Exit For is obviously more eloquent here. I got into the habit of using Gotos in this manner due to the lack of a "Continue For" in larger projects. But when I'm only returning one result, I can simply exit. Thanks for the tip!
BaronVonWasteland33 karma
In case it helps, here's a macro that will toggle calculation and tell you what the new setting is:
Sub ToggleCalc()
Dim myStr as String
Select Case Application.Calculation
Case -4105 'currently automatic
Application.Calculation = xlCalculationManual
myStr = "Manual"
Case -4135 'currently manual
Application.Calculation = xlCalculationAutomatic
myStr = "Automatic"
End Select
MsgBox "Calculation set to " & myStr
End Sub
BaronVonWasteland3 karma
First, I want to thank you for making work fun again.
Second, could you explain a little bit about how Excel sees dates and fractions so that I can understand why things turn out wonky sometimes?
BaronVonWasteland2 karma
Then you can use this instead
Sub WhichCalc()
Dim myStr as String
Select Case Application.Calculation
Case -4105
myStr = "Automatic"
Case -4135
myStr = "Manual"
End Select
MsgBox "Calculation is currently " & myStr
End Sub
BaronVonWasteland591 karma
In the meantime, you can use this:
It's pretty self explanatory; due to the possibility of needing to go backwards(aka left) of the lookup column, you need to tell Excel which column the lookup column is in. This function only works where the final argument of a normal VLOOKUP would have been False or 0.
View HistoryShare Link