A family of Microsoft spreadsheet software with tools for analyzing, charting, and communicating data.
Interesting one.
As you may know, Excel has two notations for addresses: A1 and R1C1.
Cell B3 would be R3C2 in R1C1 notation.
You can switch Excel between those two notations on File > Options > Formulas > R1C1 reference style
Your first version uses R1C1 notation for the formula and only works when Excel is in R1C1 reference style; the second uses A1 notation and only works when Excel is in A1 reference style.
This looks like bad design to me, and I will report it to the Excel product team.
To have the macro work in whichever reference style the user has chosen (assuming the list is in column C):
With Worksheets("Min Cost").Range("B10").Validation
.Delete
If Application.ReferenceStyle = xlR1C1 Then
.Add Type:=xlValidateList, AlertStyle:=xlValidAlertStop, Operator:= _
xlBetween, Formula1:="='Step Master'!R2C3:R" & masterstepsrows & "C3"
Else
.Add Type:=xlValidateList, AlertStyle:=xlValidAlertStop, Operator:= _
xlBetween, Formula1:="='Step Master'!C2:C" & masterstepsrows
End If
.IgnoreBlank = True
.InCellDropdown = True
.InputTitle = ""
.ErrorTitle = ""
.InputMessage = ""
.ErrorMessage = ""
.ShowInput = True
.ShowError = True
End With
Hi Bill!
Thanks for the help! it turns out that I forgot to unprotect the worksheet in the end.
:S