- Sub DateConvFormat()
- Dim Rng As Range
- Dim Cell As Range
- Dim FormulaCells As Range
- Dim ConstCells As Range
- If ActiveWorkbook.Date1904 = True Then
- ActiveWorkbook.Date1904 = False
- Else
- Exit Sub
- End If
- On Error Resume Next
- Set FormulaCells = Me.UsedRange.SpecialCells(xlFormulas, xlNumbers)
- Set ConstCells = Me.UsedRange.SpecialCells(xlConstants, xlNumbers)
- Set Rng = Union(FormulaCells, ConstCells)
- For Each Cell In Rng
- If IsDate(Cell) Then
- Cell.Value = Cell.Value + 1462
- Cell.Interior.Color = vbGreen
- End If
- Next Cell
- End Sub
Recent Pastes