Can any one help writing a macro to delete the row if part # starts with 800- & 550 the #'s are in column A
Can any one help writing a macro to delete the row if part # starts with 800- & 550 the #'s are in column A
Last edited by ATX; 10-05-2011 at 03:48 PM.
Please revise your post title to something more specific like macro to delete entire row based on cell contents so that you're not in violation of forum rule #1. I'll post code as soon as it's amended.
If your question has been satisfactorily addressed, please consider marking it solved. Click the Thread Tools dropdown and select Mark thread as solved.
Also, you might want to add to the user's reputation by clicking the star icon in the lower left corner of the post with the answer- it's why we do what we do...
Thomas Lafferty
Analyst/Programmer
que? if part # starts with 800? do you think you could provide an example sheet?
Hi GeneralDisarray - I have a code solution I can provide, but can't do so just yet. The forum moderators would rightly crack down on this since this post's title is too ambiguous.
Good now, TL.
Entia non sunt multiplicanda sine necessitate
Assuming you mean that the first ten characters of the cells in the A column need to be tested for the characters 800- & 550:![]()
Please Login or Register to view this content.
sorry, had it open for a moment before replying....just didn't see your reply
No worries - just means you're anxious to help, which is a good sign.
hi, ATX, option without looping, click "Start"
Thanks Guys for the quick response but i am Not sure if i have this set up right i run the macro and no part are deleted
Sub Export()
'
' Export Macro
' Export
'
'
Range("A:B,D:G,J:O,R:W").Select
Range("R1").Activate
Selection.Delete Shift:=xlToLeft
Columns("B:B").Select
Selection.Cut
Columns("D:D").Select
Selection.Insert Shift:=xlToRight
Cells.Select
Cells.EntireColumn.AutoFit
Range("A2").Select
End Sub
Sub DeleteRow()
Dim lngLastRow As Long
lngLastRow = Cells.SpecialCells(xlCellTypeLastCell).Row
For Each c In Range("A1:A" & lngLastRow)
If Left(c.Value, 10) = "800- & 550" Then c.EntireRow.Delete
Next
End Sub
please check attachment, run code "test"
PS. Any posted code must be enclosed in code tags
Thanks watersev that worked question would i be able to add more part to delete in this code
.AutoFilter 1, "800-*", xlOr, "550*"
Hi ATX
Hope this code helps you just paste values in the highlighted yellow color.
If ((ActiveCell.Value() = "0")) Then
Thanks![]()
Please Login or Register to view this content.
farrukh
hi, ATX, as an option it can be done this way with the help of Autofilter, instead of A,B,C,D,F... you can put other conditions or delete them if not required
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks