PDA

View Full Version : Convert all columns with dates to serial numbers vba



etonline
01-06-2021, 10:02 AM
Hi All!

I am trying to convert all columns with dates in a workbook to serial numbers, without success, I have searched the internet with not much joy, all I have been able to try is range ("k:m").numberformat = number, this changes most but leaves some still as dates. I can only presume there is some formatting in the data I am receiving which is stopping all dates changing

is there anyway in vba to ensure all dates are changed?

I will keep looking but any help would be appreciated.

rollis13
01-06-2021, 09:35 PM
If the cells are formatted text just multiple the column x 1.
You can also use Paste Special to do this: write 1 in a cell, copy it, select the columns with the dates and apply Paste Special and select operation: Multiply