user155754
user155754

Reputation: 93

Excel vba - change format of date

I have a column with dates that are stored as d.m.yyyy. h:mm:ss.

And the cell format isn't even date it's general. To use it as a date I need to replace that dot with "". So I used this code:

Format(Date, "d.m.yyyy h:mm:ss")

But it changed all dates to todays date.

Upvotes: 0

Views: 125

Answers (1)

user8355222
user8355222

Reputation: 51

The call of Date returns the current date. You have to use the cell value instead, like Format(Cells(row,column), "d.m.yyyy h:mm:ss"), after you replaced the dot at the end of the year value.

Upvotes: 2

Related Questions