I would like to insert a data validation list that grabs data from another sheet. the column the list will be generated from is stored in another variable that is dynamic. My code so far is:
pRange = Sheets("Payer Output").Cells(24, 3).Value
With Sheets("Payer Output").Range("C23").Validation
.Delete
.Add Type:=xlValidateList, AlertStyle:=xlValidAlertStop, _
Operator:=xlBetween, Formula1:=Sheets("Payers in Top 4").Cells(3, pRange)
.InCellDropdown = True
.InputTitle = ""
.ErrorTitle = ""
.InputMessage = ""
.ErrorMessage = ""
.ShowInput = True
.ShowError = True
End With
This formula generates a list, and looks in the correct column, however the current code only specifies the list should look in a single cell, so when the list is generated, there is only one value. How do I specify a range of cells for the 'formula1:=' line? I've tried:
Formula1:=Sheets("Payers in Top 4").Range(Cells(3, pRange), Cells(10,pRange))
But this does not work. Thank you for your help!
.Cellsand.Rangemust be qualified. ChangeFormula1:=Sheets("Payers in Top 4").Range(Cells(3, pRange), Cells(10,pRange))toFormula1:=Sheets("Payers in Top 4").Range(Sheets("Payers in Top 4").Cells(3, pRange), Sheets("Payers in Top 4").Cells(10,pRange))- Scott Craner