Thanks, it work wonderfully! :)
bless you.
Daniel.
On Friday, May 30, 2014 9:46:29 AM UTC, Abhi wrote:
>
> Try this:
>
> Private Sub test()
> Dim myrng As Range
> Set myrng = ActiveSheet.UsedRange
> For Each cell In myrng
> If IsDate(cell.Value) = True Then
> cell.NumberFormat = "dd/mm
Try this:
Private Sub test()
Dim myrng As Range
Set myrng = ActiveSheet.UsedRange
For Each cell In myrng
If IsDate(cell.Value) = True Then
cell.NumberFormat = "dd/mm/"
Else
cell.NumberFormat = "_(* #,##0.00_);_(* (#,##0.00);_(* ""-""??_);_(@_)"
End If
Next cell
End Sub
HTH/A
I also tried to write:
FinalRow = Cells(Rows.Count, 1).End(xlUp).Row
For i = 1 To finalrow
If IsDate = True Then
Cells.NumberFormat = "dd/mm/"
End If
Next i
but i get an error: Argument not optional.
On Friday, May 30, 2014 12:07:47 PM UTC+3, Kof Bar wrote:
>
> I re
I recorded a macro, and this is my code, but i don't know how to change
cells containing dates to dates format:
Sub AccFormat()
'
' AccFormat macro
' Format Cells as accounting, except date cells.
'
' shortcut: Ctrlþ+Shift+A
'
Cells.Select
Selection.NumberFormat = "_(* #,##0.00_);_(* (#,#