Hi everyone,
I m trying to do a simple VLOOKUP formula with two different Dates. One of the Dates come from other Excel Document (Col A) and the other one come from a HTMLDocument (Col B).
Both columns have Date Format but column B don't recognize itself as a Date until I double click manually a cell, so it go from left alignment to right alignment. When I do a VLOOKUP between both columns, it only works when I've double clicked the cell in column B:
I've tried to modify the format of column B just before I paste the date from the HTMLDocument using this VBA formula:
But this is changing all the value of the dates cause it having problems with dd/mm/yyyy and mm/dd/yyyy. In this picture the dates should be from the first business day of the year but its changing 02/01/2023 (dd/mm/yyyy) to 01/02/2023 (dd/mm/yyyy) and so on:
How can I change the format of column B with VBA to make my VLOOKUP work in format "dd/mm/yyyy"?
I tried google but no success. I'm new here so thanks in advance.
Regards
I m trying to do a simple VLOOKUP formula with two different Dates. One of the Dates come from other Excel Document (Col A) and the other one come from a HTMLDocument (Col B).
Both columns have Date Format but column B don't recognize itself as a Date until I double click manually a cell, so it go from left alignment to right alignment. When I do a VLOOKUP between both columns, it only works when I've double clicked the cell in column B:
I've tried to modify the format of column B just before I paste the date from the HTMLDocument using this VBA formula:
VBA Code:
ThisWorkbook.Worksheets("hoja").Range("B:B").NumberFormat = "dd/mm/yyyy"
How can I change the format of column B with VBA to make my VLOOKUP work in format "dd/mm/yyyy"?
I tried google but no success. I'm new here so thanks in advance.
Regards