Hi all,
I am trying to save filters so I can restore later and the logic that sets my criteria1 value fails with "1004 application or object defined runtime error" when the filtered column is a date.
Has anyone figured a way to do this when dealing with dates? I also have a problem restoring color filter objects but I have seen threads that this is not possible so I have decided to issue a message for colors and since I do not get runtime errors, I can live with the colors issue unless someone has an answer to that one also
thanks in advance and happy holidays everyone
mike
extract of code where filter fails:
Select Case .Operator
Case 1, 2 'xlAnd, xlOr
filterArray(f, 1) = .Criteria1
filterArray(f, 2) = .Operator
filterArray(f, 3) = .Criteria2
Case 0, 3 To 7
filterArray(f, 1) = .Criteria1 <- runtime error here with date filter
filterArray(f, 2) = .Operator
Case Else
filterArray(f, 2) = .Operator
colorcolcount = colorcolcount + 1
strArray = Split(Cells(1, f).Address, "$")
colorcol = strArray(1)
End Select
I am trying to save filters so I can restore later and the logic that sets my criteria1 value fails with "1004 application or object defined runtime error" when the filtered column is a date.
Has anyone figured a way to do this when dealing with dates? I also have a problem restoring color filter objects but I have seen threads that this is not possible so I have decided to issue a message for colors and since I do not get runtime errors, I can live with the colors issue unless someone has an answer to that one also
thanks in advance and happy holidays everyone
mike
extract of code where filter fails:
Select Case .Operator
Case 1, 2 'xlAnd, xlOr
filterArray(f, 1) = .Criteria1
filterArray(f, 2) = .Operator
filterArray(f, 3) = .Criteria2
Case 0, 3 To 7
filterArray(f, 1) = .Criteria1 <- runtime error here with date filter
filterArray(f, 2) = .Operator
Case Else
filterArray(f, 2) = .Operator
colorcolcount = colorcolcount + 1
strArray = Split(Cells(1, f).Address, "$")
colorcol = strArray(1)
End Select