james_lankford
Well-known Member
- Joined
- Jan 11, 2009
- Messages
- 1,216
let's say column A contains a date an error happened in some process (this is pulled from a database, I have no idea how many rows there will be or what the dates will be)
in column B the user will type in the corrective action taken
in column C the user will enter the date the corrective action was taken
I want to make sure the user enters a date >= to the date of the error (so column C must be >= column A)
I can't figure out what the Formula1 parameter of the Add method should be
for row 2 I want it to be A2
for row 3 I want it to be A3
and so on
I've tried offset of the active cell but that didn't work; I really have no idea what I'm doing
ok, forget it
I put Formula1:="=A2"
and it seems to "fill down" correctly
in column B the user will type in the corrective action taken
in column C the user will enter the date the corrective action was taken
I want to make sure the user enters a date >= to the date of the error (so column C must be >= column A)
I can't figure out what the Formula1 parameter of the Add method should be
for row 2 I want it to be A2
for row 3 I want it to be A3
and so on
I've tried offset of the active cell but that didn't work; I really have no idea what I'm doing
Code:
' row 1 contains the header, so I start on row 2
With .Range(.Cells(2, 3), .Cells(.Rows.Count, 3)).Validation
.Delete
.Add Type:=xlValidateDate, AlertStyle:=xlValidAlertStop, Operator:=xlGreaterEqual, Formula1:="=" & ??????
.IgnoreBlank = True
.InCellDropdown = True
.InputTitle = "Date of corrective action"
.InputMessage = "Please enter the date of the corrective action."
.ErrorTitle = "I'm sorry"
.ErrorMessage = "There was an error. Please hit Cancel and try again."
.ShowInput = True
.ShowError = True
End With
ok, forget it
I put Formula1:="=A2"
and it seems to "fill down" correctly
Last edited: