Hi all,
I have dates in the following form:
29/05/2011 07:00:00
I also have a macro to automatically fill a sheet with dates from a selected start date and end date:
I then have a vlookup that looks up the relevent data in the "BoundGraph" sheet.
However I keep getting an NA error as the date formats are different.
I have tried changing the date format in the sheet that is being looked up, but even though it doesn't display the 07:00 bit, it is still in the cell value.
Does anyone have any solutions to this issue?
Thanks in advance
I have dates in the following form:
29/05/2011 07:00:00
I also have a macro to automatically fill a sheet with dates from a selected start date and end date:
Code:
Public Sub Dates2()
Dim StDate As Date
Dim EnDate As Date
Dim IntRow As Integer
Dim CuDate As Date
Dim LRow As Long
LRow = Sheets("BoundGraph").Range("A" & Rows.Count).End(xlUp).Row
StDate = Sheets("ControlPage").Cells(25, 10).Value
EnDate = Sheets("ControlPage").Cells(26, 10).Value
CuDate = StDate - 1
IntRow = 2
Sheets("BoundGraph").Select
Cells.Clear
Do
CuDate = CuDate + 1
IntRow = IntRow + 1
Sheets("BoundGraph").Range("A" & IntRow).Value = CuDate
Loop Until CuDate = EnDate
End Sub
I then have a vlookup that looks up the relevent data in the "BoundGraph" sheet.
However I keep getting an NA error as the date formats are different.
I have tried changing the date format in the sheet that is being looked up, but even though it doesn't display the 07:00 bit, it is still in the cell value.
Does anyone have any solutions to this issue?
Thanks in advance