Hello everyone,
I am quite new to the VBA world. As you see in the title I have an issue with one date variable. I have to write a subroutine which, among others, has to check if the dates inserted in one column are today or in the past and then change the values in another column accordingly.
This is what I came up with so far:
Dim ReleaseDate As Date
Dim Status As String
Dim NewStatus As String
Columns("AV").Select
Range("AV160:AV2959") = ReleaseDate
Columns("AL").Select
Range("AL160:AL2959") = Status
If ReleaseDate <= Date Then NewStatus = "Available"
The actual problem is than when the code reaches the release date column and steps into the if, it changes all the values from the normal format (dd.mm.yyyy) into this : 12:00:00 AM. The following step is then somehow ignored, more precisely the whole status column is emptied.
I am using the Excel 2010 version. I would appreciate if you could help me solve this issue. Thanks in advance!
I am quite new to the VBA world. As you see in the title I have an issue with one date variable. I have to write a subroutine which, among others, has to check if the dates inserted in one column are today or in the past and then change the values in another column accordingly.
This is what I came up with so far:
Dim ReleaseDate As Date
Dim Status As String
Dim NewStatus As String
Columns("AV").Select
Range("AV160:AV2959") = ReleaseDate
Columns("AL").Select
Range("AL160:AL2959") = Status
If ReleaseDate <= Date Then NewStatus = "Available"
The actual problem is than when the code reaches the release date column and steps into the if, it changes all the values from the normal format (dd.mm.yyyy) into this : 12:00:00 AM. The following step is then somehow ignored, more precisely the whole status column is emptied.
I am using the Excel 2010 version. I would appreciate if you could help me solve this issue. Thanks in advance!