hi all
I have this code that does not work
What I have is a column where people have entered the time as eg 2:00 or 2.00 or 2:00pm or 2.00pm for invites
My ideal solution I would like to do is
1.Remove all letters from the cells
2.Change all . to :
3.Format the cells as time to produce 2:00pm (no seconds) and convert 24hr time to standard eg 14:00 becomes 2.00pm
4.Change the : back to . for asthetics as its for invites so 2.00pm
5.Add word "from" to the time using
Any help appreciated
I have this code that does not work
Code:
Sub replace()
Range("A1:A100").Select
Dim c As Range
For Each c In Selection
Worksheets("Sheet1").Columns("A").replace _
What:=":", replacement:=".", LookAt:=xlPart
If c.Value <> "" Then c.Value = "From " & c.Value
Next
End Sub
What I have is a column where people have entered the time as eg 2:00 or 2.00 or 2:00pm or 2.00pm for invites
My ideal solution I would like to do is
1.Remove all letters from the cells
2.Change all . to :
3.Format the cells as time to produce 2:00pm (no seconds) and convert 24hr time to standard eg 14:00 becomes 2.00pm
4.Change the : back to . for asthetics as its for invites so 2.00pm
5.Add word "from" to the time using
Code:
If c.Value <> "" Then c.Value = "From " & c.Value
Any help appreciated