sasa
06-18-2008, 11:24 PM
Hi All,
I ask if it is possible in a way similar this macro:
sub Del_Rows()
Dim MyCell As Long
Dim i As Long
For i = Cells(1, Columns.Count).End(xlToLeft).Column To 1 Step -1
If Cells(1, i).Value = "Data" Then Cells(1, i).EntireColumn.Delete
Next i
For MyCell = ActiveSheet.UsedRange.Rows.Count To 2 Step -1
If Application.WorksheetFunction.CountIf(Rows(MyCell), "Happy") >= 1 _
Or Application.WorksheetFunction.CountIf(Rows(MyCell), "Angry") >= 1 _
Then Rows(MyCell).EntireRow.Delete
Next MyCell
End Sub
to substitute the delete stuff with a move up option. In other words to move up the under list of items in the considered columns after deleting the two words.
Thanks in advance
sasa
I ask if it is possible in a way similar this macro:
sub Del_Rows()
Dim MyCell As Long
Dim i As Long
For i = Cells(1, Columns.Count).End(xlToLeft).Column To 1 Step -1
If Cells(1, i).Value = "Data" Then Cells(1, i).EntireColumn.Delete
Next i
For MyCell = ActiveSheet.UsedRange.Rows.Count To 2 Step -1
If Application.WorksheetFunction.CountIf(Rows(MyCell), "Happy") >= 1 _
Or Application.WorksheetFunction.CountIf(Rows(MyCell), "Angry") >= 1 _
Then Rows(MyCell).EntireRow.Delete
Next MyCell
End Sub
to substitute the delete stuff with a move up option. In other words to move up the under list of items in the considered columns after deleting the two words.
Thanks in advance
sasa