Thanks for responding, I implemented the code above but I received
syntax error at line 19=
Destination:=Cells(i - 1, "A").Offset(0, 3)
If I remove this portion, the script runs and removes all but one ro
of data for each date and only puts in the first login time. Atleast
am seeing progression, I am very greatful. I tried to change the synta
a little to see if I could get it to work, but no luck. I studied you
code for a few hours and some what understand what you are doing. Her
is the syntax again. Column A is the Date, Column B is the login time
and Column C is the logout time. Just to clarify, row 1 I do have th
column headings of "Date","Login", and "Logout". I was not sure i
having column headings was throwing off your code. Either way I trie
to remove the Headings row and run the script, but still received th
same error. Thanks again for all your help
Sub TidyDates()
Dim cLastRow As Long
Dim rng As Range
Dim i As Long
Columns("B:B").TextToColumns Destination:=Range("B1"), _
DataType:=xlDelimited, _
TextQualifier:=xlDoubleQuote, _
ConsecutiveDelimiter:=True, _
Tab:=True, _
Semicolon:=False, _
Comma:=False, _
Space:=True, _
Other:=False, _
FieldInfo:=Array(Array(1, 1), Array(2, 1))
cLastRow = Cells(Rows.Count, "A").End(xlUp).Row
For i = cLastRow To 3 Step -1
If Cells(i, "A").Value = Cells(i - 1, "A").Value Then
Cells(i, "A").Offset(0, 1).Resize(1, 6).Copy
Destination:=Cells(i - 1, "A").Offset(0, 3)
If rng Is Nothing Then
Set rng = Cells(i, "A")
Else
Set rng = Union(rng, Cells(i, "A"))
End If
End If
Next i
If Not rng Is Nothing Then
rng.EntireRow.Delete
End If
End Su
--
Message posted from
http://www.ExcelForum.com