G
Gilroy
I have the need to determine if a specific range of cells
have values resulting from an autofill action.
Example:
If Range("C7").Value = "Jan", and AutoFill was used to
make C7-K7 = "Jan","Feb","Mar",etc
How can I tell programmatically that AutoFill was used to
perform this action?
I can easily do this:
ThisWorkSheet = Excel.Application.ActiveSheet
With ThisWorkSheet
If .Range("C7").Value = "Jan" _
And .Range("D7").Value = "Feb" _
And .Range("E7").Value = "Mar" _
And .Range("F7").Value = "Apr" _
And .Range("G7").Value = "May" _
And .Range("H7").Value = "Jun" _
And .Range("I7").Value = "Jul" _
And .Range("J7").Value = "Aug" _
And .Range("K7").Value = "Sep" Then
MsgBox("Cool")
Else
MsgBox("Not Cool")
End If
End With
But, that doesn't reach my goal of finding out if
AutoFill was used.
Thoughts?
have values resulting from an autofill action.
Example:
If Range("C7").Value = "Jan", and AutoFill was used to
make C7-K7 = "Jan","Feb","Mar",etc
How can I tell programmatically that AutoFill was used to
perform this action?
I can easily do this:
ThisWorkSheet = Excel.Application.ActiveSheet
With ThisWorkSheet
If .Range("C7").Value = "Jan" _
And .Range("D7").Value = "Feb" _
And .Range("E7").Value = "Mar" _
And .Range("F7").Value = "Apr" _
And .Range("G7").Value = "May" _
And .Range("H7").Value = "Jun" _
And .Range("I7").Value = "Jul" _
And .Range("J7").Value = "Aug" _
And .Range("K7").Value = "Sep" Then
MsgBox("Cool")
Else
MsgBox("Not Cool")
End If
End With
But, that doesn't reach my goal of finding out if
AutoFill was used.
Thoughts?