Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Need help with Macros

0 views
Skip to first unread message

Amjad Barakat

unread,
Oct 25, 2002, 7:56:40 PM10/25/02
to
I am trying to automate some stuff using macros in excel. the record macro
feature can only do so much but it helped with all of the tedious stuff.
What I want to include in my Macros is a way to delete entire rows based on
the values of cells in one column.

Any help is appreciated.

Thanks

Amjad


paul tazzyman

unread,
Oct 25, 2002, 9:40:58 PM10/25/02
to
"Amjad Barakat" <am...@barakat.net> wrote in message
news:apclqt$sh6$1...@news.izap.com...
Refer to
Macro to delete specific rows

in NG microsoft.public.excel.programming

Paul

unread,
Oct 25, 2002, 8:47:00 PM10/25/02
to
Amjad, see if this will help you

Sub DeleteSpecifiedRows()
' This macro deletes all rows on the active worksheet
' that have the user input specified value in column C.
Dim iRow As Long
Dim SpecValue As String

SpecValue = InputBox("Enter column C value", "Selective Row Deletion")

If SpecValue = "" Then Exit Sub

For iRow = ActiveSheet.UsedRange.Rows.Count To 1 Step -1
If Cells(iRow, 3) = SpecValue Then Rows(iRow).Delete
Next iRow

End Sub

"Amjad Barakat" <am...@barakat.net> wrote in message
news:apclqt$sh6$1...@news.izap.com...

Amjad Barakat

unread,
Oct 29, 2002, 5:08:27 PM10/29/02
to
How can I delete rows based on a cell number value in a macro?

Thanks

Nandhakumar Murugesan

unread,
Oct 31, 2002, 2:04:09 PM10/31/02
to
this should work.. if it does not pls reply back

Sub test()
Dim i As Integer
Dim j As Integer
Dim k As String

For i = 1 To 24
j = i Mod 2
If j = 0 Then
k = Chr(64 + 1)
Range(k & i & ":" & "iv" & "1").Select
Selection.Delete
End If
Next i
End Sub

"Amjad Barakat" <am...@barakat.net> wrote in message

news:apn0vs$mrq$1...@news.izap.com...

0 new messages