Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.misc
|
|||
|
|||
Help with rest of forumla - Delete rows based on criteria
I am extracting information from a named range of information from one sheet
to another based on matching sets of data. That is working great but I'm wondering if there is a formula that will expand this to delete rows when the salary is returned as 0.00. Here is what I have so far: =SUMIF(SSNLLS,SSNLLBL,salary) (if the social on one sheet matches social on the other, return the salary information) Does anyone know of an easy formula to add to this or would I have to write a macro to delete those rows that return 0.00? Thanks so much! Mariann |
#2
Posted to microsoft.public.excel.misc
|
|||
|
|||
Help with rest of forumla - Delete rows based on criteria
Formula cannot delete a cell. You will have to write a macro.
-- If this post helps click Yes --------------- Jacob Skaria "Mariann" wrote: I am extracting information from a named range of information from one sheet to another based on matching sets of data. That is working great but I'm wondering if there is a formula that will expand this to delete rows when the salary is returned as 0.00. Here is what I have so far: =SUMIF(SSNLLS,SSNLLBL,salary) (if the social on one sheet matches social on the other, return the salary information) Does anyone know of an easy formula to add to this or would I have to write a macro to delete those rows that return 0.00? Thanks so much! Mariann |
#3
Posted to microsoft.public.excel.misc
|
|||
|
|||
Help with rest of forumla - Delete rows based on criteria
Hi,
Here you have a macro written by Ron de Bruin, just check the value to be deleted I change it to 0.00 If this helps please click yes, thanks Sub Loop_Example() Dim Firstrow As Long Dim Lastrow As Long Dim Lrow As Long Dim CalcMode As Long Dim ViewMode As Long With Application CalcMode = .Calculation .Calculation = xlCalculationManual .ScreenUpdating = False End With 'We use the ActiveSheet but you can replace this with 'Sheets("MySheet")if you want With ActiveSheet 'We select the sheet so we can change the window view .Select 'If you are in Page Break Preview Or Page Layout view go 'back to normal view, we do this for speed ViewMode = ActiveWindow.View ActiveWindow.View = xlNormalView 'Turn off Page Breaks, we do this for speed .DisplayPageBreaks = False 'Set the first and last row to loop through Firstrow = .UsedRange.Cells(1).Row Lastrow = .UsedRange.Rows(.UsedRange.Rows.Count).Row 'We loop from Lastrow to Firstrow (bottom to top) For Lrow = Lastrow To Firstrow Step -1 'We check the values in the A column in this example With .Cells(Lrow, "A") If Not IsError(.Value) Then If .Value = "0.00" Then .EntireRow.Delete 'This will delete each row with the Value "0" 'in Column A, case sensitive. End If End With Next Lrow End With ActiveWindow.View = ViewMode With Application .ScreenUpdating = True .Calculation = CalcMode End With End Sub "Mariann" wrote: I am extracting information from a named range of information from one sheet to another based on matching sets of data. That is working great but I'm wondering if there is a formula that will expand this to delete rows when the salary is returned as 0.00. Here is what I have so far: =SUMIF(SSNLLS,SSNLLBL,salary) (if the social on one sheet matches social on the other, return the salary information) Does anyone know of an easy formula to add to this or would I have to write a macro to delete those rows that return 0.00? Thanks so much! Mariann |
#4
Posted to microsoft.public.excel.misc
|
|||
|
|||
Help with rest of forumla - Delete rows based on criteria
A formula can't be used to delete a row, so you would need a macro to
do that. An alternative approach (manually) is to apply a filter to the salary column and select 0. Then you can highlight the visible cells and Edit | Delete Row, then select All from the filter pull-down. Hope this helps. Pete On Jun 10, 5:40*pm, Mariann wrote: I am extracting information from a named range of information from one sheet to another based on matching sets of data. *That is working great but I'm wondering if there is a formula that will expand this to delete rows when the salary is returned as 0.00. *Here is what I have so far: =SUMIF(SSNLLS,SSNLLBL,salary) (if the social on one sheet matches social on the other, return the salary information) Does anyone know of an easy formula to add to this or would I have to write a macro to delete those rows that return 0.00? Thanks so much! Mariann |
#5
Posted to microsoft.public.excel.misc
|
|||
|
|||
Help with rest of forumla - Delete rows based on criteria
Thanks, Jacob -
"Jacob Skaria" wrote: Formula cannot delete a cell. You will have to write a macro. -- If this post helps click Yes --------------- Jacob Skaria "Mariann" wrote: I am extracting information from a named range of information from one sheet to another based on matching sets of data. That is working great but I'm wondering if there is a formula that will expand this to delete rows when the salary is returned as 0.00. Here is what I have so far: =SUMIF(SSNLLS,SSNLLBL,salary) (if the social on one sheet matches social on the other, return the salary information) Does anyone know of an easy formula to add to this or would I have to write a macro to delete those rows that return 0.00? Thanks so much! Mariann |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Delete Rows based on criteria in excel | Excel Discussion (Misc queries) | |||
How can I delete rows programmatically based on certain criteria? | New Users to Excel | |||
How can I delete rows programmatically based on certain criteria? | Excel Worksheet Functions | |||
Delete rows based on criteria | Excel Discussion (Misc queries) | |||
Delete rows based on certain criteria | Excel Discussion (Misc queries) |