Hi Gary:
But I need it to evaluate how many rows to go down, and the dates will be
different in each row. EG: I have dates in rows C3:C30 in the 20080714
format. I need the dates to be in the 2008/07/14 format. The number of rows
will change constantly so I need to evaluate how many rows to work with.
Here is a small sample file:
Carrier Pro/Inv Date Date2 Customer
DRR CLG1510679 20080714 Gescan
DRR DAR2639057 20080714 Gescan
DRR MTL4337916 20080714 Gescan
DRR CLG1510680 20080714 Gescan
DRR DAR2639058 20080714 Gescan
DRR MTL4337917 20080714 Gescan
DRR CLG1510681 20080714 Gescan
DRR DAR2639059 20080714 Gescan
DRR MTL4337918 20080714 Gescan
DRR CLG1510682 20080714 Gescan
DRR DAR2639060 20080714 Gescan
DRR MTL4337919 20080714 Gescan
DRR CLG1510683 20080714 Gescan
DRR DAR2639061 20080714 Gescan
DRR MTL4337920 20080714 Gescan
Date2 is blank and this is where I want to show 2008/17/14.
Thanks,
"Gary''s Student" wrote:
> With 20080714 in cell C3, this macro will put the date in C4:
>
> Sub theresa()
> v = Range("C3").Value
> yr = Left(v, 4)
> mn = Mid(v, 5, 2)
> dy = Right(v, 2)
> Range("C4").Value = DateSerial(yr, mn, dy)
> End Sub
> --
> Gary''s Student - gsnu200797
>
>
> "Theresa" wrote:
>
> > Hi:
> >
> > I receive a file that contains a column of dates in a format that is not
> > recognized as a date: ie: 20080714. I am trying to create a macro to
> > insert the "/" at the required places.
> >
> > Here is the code I am using:
> >
> > Range("D3
" & Range("E65536").End(xlUp).Row).FormulaR1C1 = Trim(Left(C3, 4)
> > & "/" & Mid(C3, 5, 2) & "/" & Right(C3, 2))
> >
> > I want to look at the data in Column E to see how far to go, then take the
> > date in Column C and put it in Column D in the correct format. When I run
> > the macro, all I get is // with nothing else.
> >
> > What am I doing wrong?
> >
> > Thanks,