Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
macro
HI!
How to make a macro who will find some value (etc. 0) in a specific column (etc. column B), and erase entire row. Thanks. |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
macro
Hi
try the following macro Sub delete_rows() Dim RowNdx As Long Dim LastRow As Long Application.ScreenUpdating = False LastRow = ActiveSheet.Cells(Rows.Count, "B").End(xlUp).row For RowNdx = LastRow To 1 Step -1 with Cells(RowNdx, "B") if .value = 0 then Rows(RowNdx).Delete End If end with Next RowNdx Application.ScreenUpdating = True End Sub -- Regards Frank Kabel Frankfurt, Germany C3 wrote: HI! How to make a macro who will find some value (etc. 0) in a specific column (etc. column B), and erase entire row. Thanks. |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
macro
something like this to check column A
Sub delzeros() For i = Cells(Rows.Count, 1).End(xlUp).Row To 1 Step -1 If Cells(i, 1) = 0 Then Rows(i).Delete Next End Sub -- Don Guillett SalesAid Software "C3" wrote in message ... HI! How to make a macro who will find some value (etc. 0) in a specific column (etc. column B), and erase entire row. Thanks. |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
macro
If there is just one or no occurrence, use the Find method. Add FindNext if
multiple occurrences. -- HTH Bob Phillips ... looking out across Poole Harbour to the Purbecks (remove nothere from the email address if mailing direct) "C3" wrote in message ... HI! How to make a macro who will find some value (etc. 0) in a specific column (etc. column B), and erase entire row. Thanks. |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
macro
Keep in mind that depending upon what values are allowed in your spreadsheet, you might need to watch out for empty cells and cells with the value of FALSE. I believe that these will also evaluate to 0. If necessary you can use the IsEmpty function to test for empty cells. Also, you can use the Str function to convert your cell to a string. This should help to identify cells that are FALSE
Art |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Macro recorded... tabs & file names changed, macro hangs | Excel Worksheet Functions | |||
Macro Help Needed - Excel 2007 - Print Macro with Auto Sort | Excel Worksheet Functions | |||
My excel macro recorder no longer shows up when recording macro | Excel Discussion (Misc queries) | |||
My excel macro recorder no longer shows up when recording macro | Excel Discussion (Misc queries) | |||
Start Macro / Stop Macro / Restart Macro | Excel Programming |