View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
Jacob Skaria Jacob Skaria is offline
external usenet poster
 
Posts: 8,520
Default How to add condition to coding?

Please paste your code so as to recreate the issue..

If this post helps click Yes
--------------
Jacob Skaria


"Eric" wrote:

Thank you very much for suggestions
I get an error, which is related to missing some variable setting or With's
variable.
Do you have any suggestions on how to fix it?
Thank you very much for any suggestions
Eric

"Jarek Kujawa" wrote:

If wkbk Is Nothing And myCell.Offset(0, 2).Value < DateSerial(Year(Now),
Month(Now), Day(Now)) Then

HIH


U¿ytkownik "Eric" napisa³ w wiadomo¶ci
...
Does anyone have any suggestions on how to add condition into coding?

I would like to add the condition, please see []
If wkbk Is Nothing [and myCell.Offset(0, 2).Value is not equal today]
Then
Thanks in advance for any suggestions
Eric

======================================
Original Coding
======================================

If wkbk Is Nothing Then
myCell.Offset(0, 1).Value = "Failed to open!"
Else
wkbk.Close savechanges:=True
myCell.Offset(0, 1).Value = "ok"