Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 7
Default 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   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 8,520
Default 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   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2,276
Default 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   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 8,856
Default 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   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 7
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Delete Rows based on criteria in excel Novaglory Excel Discussion (Misc queries) 5 July 10th 07 08:29 PM
How can I delete rows programmatically based on certain criteria? nt_artagnian[_2_] New Users to Excel 2 March 8th 07 03:56 AM
How can I delete rows programmatically based on certain criteria? nt_artagnian[_2_] Excel Worksheet Functions 1 March 7th 07 05:48 PM
Delete rows based on criteria Chris_t_2k5 Excel Discussion (Misc queries) 2 April 11th 06 01:52 PM
Delete rows based on certain criteria Coal Miner Excel Discussion (Misc queries) 2 March 3rd 06 05:56 PM


All times are GMT +1. The time now is 06:29 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"