Every month I get an excel "workshop" workbook so that I can input the information into an SQL database to update the client webpage. I'm working on a macro that will reformat the worksheet to match the database table. I've gotten everything as I want except the column C ("wTime") has times in a text format of 10am, 11am, 12pm, 1pm, and 2pm. I need the cell data to convert to 10:00 AM, 11:00 AM, 12:00 PM, 1:00 PM, and 2:00 PM.
I thought it would be a simple case statement:
For this to work I'm assuming that wTime must be a Named Range so I added this above it:
I didn't get an error, but the data in column C didn't change either.
What did I miss?
Thanks everyone!
I thought it would be a simple case statement:
Code:
Select Case wTime
Case "10am"
wTime = "10:00 AM"
Case "11am"
wTime = "11:00 AM"
Case "12:00pm"
wTime = "12:00 PM"
Case "1pm"
wTime = "1:00 PM"
Case "2pm"
wTime = "2:00 PM"
End Select
For this to work I'm assuming that wTime must be a Named Range so I added this above it:
Code:
'Set wTime name to wTime column
Set Rng = ActiveSheet.Range("C:C")
ActiveSheet.Names.Add Name:="wTime", RefersTo:=Rng
I didn't get an error, but the data in column C didn't change either.
What did I miss?
Thanks everyone!