Hi again,
I have one more question
Normally when you use excel function replace all withing sheet it will replace data just in your selection.
But if you use replace all withing workbook it will change in whole sheet(s) - regardless on your selection.
And now to the point - when you use same function in vba i unfortunately havent found any option to set up replace withing sheet/workbook.
If you use find all/replace all in sheet and run same macro it will change just in selection.
But if u used find all/replace all in workbook and run same macro it will change in workbook.
- so it seems it depends only what u have set up manually in excel before running vba macro.
- I even tried to specify in vba co find&replace just in active sheet without results... it was just continuing to change whole workbook if i was using withing workbook before running macro.
Really it cant be set up directly in vba and it depends what was user doing before running macro !?!?! Seems absurd for me.
Code just to give u better picture:
I have one more question

Normally when you use excel function replace all withing sheet it will replace data just in your selection.
But if you use replace all withing workbook it will change in whole sheet(s) - regardless on your selection.
And now to the point - when you use same function in vba i unfortunately havent found any option to set up replace withing sheet/workbook.
If you use find all/replace all in sheet and run same macro it will change just in selection.
But if u used find all/replace all in workbook and run same macro it will change in workbook.
- so it seems it depends only what u have set up manually in excel before running vba macro.
- I even tried to specify in vba co find&replace just in active sheet without results... it was just continuing to change whole workbook if i was using withing workbook before running macro.
Really it cant be set up directly in vba and it depends what was user doing before running macro !?!?! Seems absurd for me.
Code just to give u better picture:
Code:
Private Sub Correct_Dates()
Application.ScreenUpdating = False
Dim Lr As Long
Dim dates As Range
Lr = Range("D5").End(xlDown).Row
For Each dates In Range("D5:E" & Lr)
If dates Like "*.*" Then
With dates
.Replace ".", "/", xlPart
.NumberFormat = "dd/mm/yy"
End With
End If
Next dates
Application.ScreenUpdating = True
End Sub