Folks,
Please help me to auto format the Column "D" and "E" to "DD-MM-YY" format automatically and remove "A" Character. I have attached the excel file for better explains.
Thank you so much in advance
Folks,
Please help me to auto format the Column "D" and "E" to "DD-MM-YY" format automatically and remove "A" Character. I have attached the excel file for better explains.
Thank you so much in advance
Last edited by krjoshi; 02-16-2014 at 04:16 PM.
Cheers,
Joshi
Being with a winner makes you a winner
Hi Joshi,
You have some Text instead of numbers for your finish date/times. See if the helper columns lets you understand how I fixed these problems.
One test is worth a thousand opinions.
Click the * Add Reputation below to say thanks.
Hi Marvin,
Thanks for your help and advice. Can you please help me to build a macro to replace the formula since the row data will vary frequenlty (then I need to fill down the formula al the time) , and some times both Start and Finish date columns will have "A" text. Please help me to fix these issues.
Thanks,
Joshi
Last edited by krjoshi; 02-16-2014 at 03:59 PM.
Hi krjoshi,
added an event procedure which automatically formats all new dates that you add, as well as a macro that formats the existing. See the attached and try if it works for you.
In Module1:
In the Sheet1 module:Sub FormatDates() Dim rng As Range, c As Range With Sheets("Sheet1") Set rng = .Range("A1").CurrentRegion Set rng = Application.Intersect(rng, rng.Offset(2), .Columns("D:E")) End With For Each c In rng If Right(c.Value, 2) = " A" Then c.Value = Replace(c.Value, " A", "") If c.NumberFormat <> "DD-MM-YY" Then c.NumberFormat = "DD-MM-YY" Next c End Sub
Regards, berlanPrivate Sub Worksheet_change(ByVal Target As Range) If Application.Intersect(Target, Columns("D:E")) Is Nothing Then Exit Sub Application.EnableEvents = False With Target If Right(.Value, 2) = " A" Then .Value = Replace(.Value, " A", "") If .NumberFormat <> "DD-MM-YY" Then .NumberFormat = "DD-MM-YY" End With Application.EnableEvents = True End Sub
Hi Berlan and MarvinP, thanks for your time and great help. Thank you so much once again.
Joshi
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks