PDA

View Full Version : VBA Help in Converting text result of Date into Date Format !!



malleshg24
10-29-2017, 09:20 PM
Hi Team, :help:banghead:

In my daily report when extracted data, I get last modified by user column in
2017-08-10: 04:30 This format, this is a text.checked with =ISNUMBER(K2)
So here I manually have to Delete time [04:30] , =TEXT(k2,"DD-MMM-YY") with this formula I get the desired result.

I have 6 sheets, but want to format only in sheets{1,2,4,5}
I have this type of date format(2017-08-10: 04:30) in Column(K:K, L:L, R:R, S:S) Respectively

Can you plz assist/ give me some tips to work on this.
My Tried code are here.

Sub Test()
Dim ws As Worksheet, lr As Long
For Each ws In Worksheets
Select Case ws.Name
Case "Sheet1", "Sheet2", "Sheet4" , "Sheet5"
' lr = ws.Cells(Rows.Count, "A").End(xlUp).Row




End Select
Next ws
End Sub

Thanks in Advance for your precious Time.

Regards,
Mallesh

Kenneth Hobs
10-30-2017, 07:16 AM
Why not convert it to date and then set the number format to suit?
=DATEVALUE(LEFT(A1,FIND(":",A1)-1))