The Gunslinger
Board Regular
- Joined
- Dec 28, 2003
- Messages
- 76
ok, i'm stuck again!
I have a line of code, that is supposed to simply check for the presence of a date in one worksheets cell, and then check to see if it's found in a column of cells in another worksheet
it sounds simple, and i thought i'd nailed it, but i keep getting a Run Time Error 13 - Type mismatch
here's the line with the issue
for context purposes, this line of code then runs into a loop that removes all said dates from the second worksheet, and here's the full code, not bug checked yet as i can't get past the previous issue
i'm obviously going to keep working on this but it's driving me up the wall, because obviously i've missed something simple, but can't see it, any help would be appreciated
I have a line of code, that is supposed to simply check for the presence of a date in one worksheets cell, and then check to see if it's found in a column of cells in another worksheet
it sounds simple, and i thought i'd nailed it, but i keep getting a Run Time Error 13 - Type mismatch
here's the line with the issue
Code:
If Trim(ActiveSheet.Range("D5").Value) <> "" And Evaluate("COUNTIF(Sheet3!J18:J626," & CLng(ActiveSheet.Range("D5").Value) & ")") > 0 Then
for context purposes, this line of code then runs into a loop that removes all said dates from the second worksheet, and here's the full code, not bug checked yet as i can't get past the previous issue
Code:
If Trim(ActiveSheet.Range("D5").Value) <> "" And Evaluate("COUNTIF(Sheet3!J18:J626," & CLng(ActiveSheet.Range("D5").Value) & ")") > 0 Then
With Sheet3.Range("J18:J626")
Set c = .Find(CLng(ActiveSheet.Range("D5").Value), LookIn:=xlValues)
If Not c Is Nothing Then
firstAddress = c.Address
Do
c.Offset(0, 1).Value = ""
c.Offset(0, 3).Value = ""
c.Offset(0, 1).Locked = False
c.Offset(0, 3).Locked = False
c.Value = ""
Set c = .FindNext(c)
Loop While Not c Is Nothing And c.Address <> firstAddress
End If
End With
End If
i'm obviously going to keep working on this but it's driving me up the wall, because obviously i've missed something simple, but can't see it, any help would be appreciated