Hi,
I have been struggling with this error for weeks.
I have an Excel document where I copy a generated data workbook into a new workbook where i paste it into a dedicated DATA tab.
From here I have recorded a macro that selects column B and replaces every instance of "." with "/". This is to change dd.mm.yyyy to dd/mm/yyyy. I have tried simply changing the format but it does not work. The goal of doing this is to have Excel recognize the cell value as a date and compiling the dates when i put a filter on the header. Somehow when i do this manually, or even when recording the macro, it works perfectly, but when i run the macro, it seems to only replace half (or less) of the cells, and it changes cell values to date that have not yet been such as 06/12/2022.
I have tried debugging, I have compared the lines in VBA to other examples found on google but i cant find what the error is.
Can anyone help me?
VBA also posted beneath
Sub UPDATE_DATA()
'
' UPDATE_DATA Macro
'
'
Columns("B:B").Select
Selection.Replace What:=".", Replacement:="/", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
End Sub
I have been struggling with this error for weeks.
I have an Excel document where I copy a generated data workbook into a new workbook where i paste it into a dedicated DATA tab.
From here I have recorded a macro that selects column B and replaces every instance of "." with "/". This is to change dd.mm.yyyy to dd/mm/yyyy. I have tried simply changing the format but it does not work. The goal of doing this is to have Excel recognize the cell value as a date and compiling the dates when i put a filter on the header. Somehow when i do this manually, or even when recording the macro, it works perfectly, but when i run the macro, it seems to only replace half (or less) of the cells, and it changes cell values to date that have not yet been such as 06/12/2022.
I have tried debugging, I have compared the lines in VBA to other examples found on google but i cant find what the error is.
Can anyone help me?
VBA also posted beneath
Sub UPDATE_DATA()
'
' UPDATE_DATA Macro
'
'
Columns("B:B").Select
Selection.Replace What:=".", Replacement:="/", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
End Sub