On 2002-02-22 20:09, Albert wrote:
sorry I can't do that as there is data in 4 other columns to the right of the days and date columns which has to remain with the correct date.
I have done this before using a macro with 'find, replace' but cannot remember how to do it again, and I dont have the original macro either.
Hi Albert
I/m no Macro expert
but I think the following code will do what you want.
first you should select all the data on your sheet and sort by date order to remove the existing blank rows.
then run this macro
Sub insertrow()
Application.Goto Reference:="R65536C1"
Selection.End(xlUp).Select
lastrow = Selection.Row
Range("A2").Select
For t = 2 To lastrow
If (Left(ActiveCell.Value, 3) = "Tue") Then
ActiveCell.Offset(1, 0).Range("A1").Select
z = ActiveCell.Row
Rows(z & ":" & z).Select
Selection.Insert Shift:=xlDown
ActiveCell.Offset(1, 0).Range("A1").Select
Else
ActiveCell.Offset(1, 0).Range("A1").Select
End If
Next t
End Sub
HTH