Thread: [Solved] trouble with code
View Single Post
 
Old 04-17-2018, 06:40 AM
gummybear gummybear is offline Windows 7 64bit Office 2010 64bit
Novice
 
Join Date: Apr 2018
Posts: 9
gummybear is on a distinguished road
Default trouble with code

I am very new to excel and vba code and forums. I will try to explain my issue to the best of my knowledge. I will make mistake and my not give the proper grammar so if you would be kind. Thank you. Here is my issue. I am making a comparison with dates that I have on my spreadsheet and from the website. I wrote this code:
If dos >= sDate And dos <= Term _
Or dos >= sDate And Term = #1/1/1900# Then
[f1].Offset(i - 1, 0) = "covered"
else
[f1].Offset(i - 1, 0) = " not covered"

It works fine until the website returns a blank cell. I then get an error message "type mismatch" I undertand it is because the cell is blank. I though putting #1/1/1900# would fix this but it doesn't. I also noticed in my local window the value for Term looks like this " ". Can this be fixed?
Attached Images
File Type: png type mismatch error.PNG (626 Bytes, 20 views)
Reply With Quote