Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() Hi Everyone, I have a column that contains serial numbers in this format - mmddyy - ### (i.e. 060308-001). I would like to split out the first 6 digits and convert it into a date (mm/dd/yy). I tried to do this with the following code and it doesn't work: '------start code startserial = Format(Me.Start_Serial, "mm/dd/yy") endserial = Format(Me.End_Serial, "mm/dd/yy") For Each SerialRng In SerialRng.cells myserial = Left(SerialRng.cells(SerialRng.row, 4), 6) record_serial = Format(myserial, "mm/dd/yy") On Error Goto Next SerialRng ***(see note below) If record_serial = startserial And record_serial <= endserial Then SerialRng.EntireRow.Copy Sheets("Data").Select cells(Rows.count, 1).End(xlUp)(2).Select Selection.PasteSpecial Paste:=xlAll End If Next SerialRng '---- end code ***here I would like for it to skip to the next SerialRng if cannot get the first 6 digit to convert into a date - sometimes the field may not be a serial number and just some other ID number so it can't be converted into a date. Please help if possible. Thank you! tracktraining -- Learning |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
How i can convert digits inwords? | New Users to Excel | |||
convert digits in words | Excel Discussion (Misc queries) | |||
How to convert digits into text | Excel Worksheet Functions | |||
How to convert the values into 3 digits? | Excel Discussion (Misc queries) | |||
Convert string of digits into a date | Excel Worksheet Functions |