JamesW
Well-known Member
- Joined
- Oct 30, 2009
- Messages
- 1,197
Hi guys,
I am using the following code which sort of works fine:
The problem is that I need to pivot the data and then sort the pivot by date descending.
This all works fine, however the blank cells (there is a blank cell for each set of dates) are showing as "(blank)" in my pivot, and not just blank (""), therefore when I come to do the sort it is putting "(blank)" first, which is ****ing up my vlookup.
I assume this is because the blank cells are also being changed to date format, but may be mistaken.
Is there anything I can change in my code?
Cheers,
James
I am using the following code which sort of works fine:
Code:
With Range("F2:F" & Cells(Rows.Count, "F").End(xlUp).Row)
varDates = .Value
For lngIndex = LBound(varDates) To UBound(varDates)
If Len(varDates(lngIndex, 1)) > 0 Then varDates(lngIndex, 1) = (Replace(varDates(lngIndex, 1), ".", "/"))
Next lngIndex
.NumberFormat = "dd/mm/yyyy"
.Value = varDates
End With
This all works fine, however the blank cells (there is a blank cell for each set of dates) are showing as "(blank)" in my pivot, and not just blank (""), therefore when I come to do the sort it is putting "(blank)" first, which is ****ing up my vlookup.
I assume this is because the blank cells are also being changed to date format, but may be mistaken.
Is there anything I can change in my code?
Cheers,
James