Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Creating a Macro that will Delete if anything less than 20%

Hi I wanted to know what the code would be to delete an entire row if
that cells column H is less than 20.0%. Then after that, if column I
is less than 20% delete those rows. I appreciate your help. Thanks
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,885
Default Creating a Macro that will Delete if anything less than 20%

Hi
as a starting point:
http://www.xldynamic.com/source/xld.Deleting.html

--
Regards
Frank Kabel
Frankfurt, Germany

"Julienne" schrieb im Newsbeitrag
om...
Hi I wanted to know what the code would be to delete an entire row if
that cells column H is less than 20.0%. Then after that, if column I
is less than 20% delete those rows. I appreciate your help. Thanks


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 42
Default Creating a Macro that will Delete if anything less than 20%

Try this out

Range("a1").Select
Do Until ActiveCell = ""

If ActiveCell.Offset(columnoffset:=11) < 0.2 Then
ActiveCell.EntireRow.Delete
Else
ActiveCell.Offset(rowoffset:=1).Activate
End If

Loop

Range("A1").Select

Do Until ActiveCell = ""

If ActiveCell.Offset(columnoffset:=8) < 0.2 Then
ActiveCell.EntireRow.Delete
Else
ActiveCell.Offset(rowoffset:=1).Activate
End If
Loop

-----Original Message-----
Hi I wanted to know what the code would be to delete an

entire row if
that cells column H is less than 20.0%. Then after that,

if column I
is less than 20% delete those rows. I appreciate your

help. Thanks
.

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Creating a Macro that will Delete if anything less than 20%


The code doesnt work because it loops and doesn't stop unless i hi
ctrl- break. not sure how to change

--
ICSAnalys
-----------------------------------------------------------------------
ICSAnalyst's Profile: http://www.excelforum.com/member.php...fo&userid=1509
View this thread: http://www.excelforum.com/showthread.php?threadid=27716

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 863
Default Creating a Macro that will Delete if anything less than 20%

Have you posted the code (I can't find it...)? If not, please do so.


On Mon, 15 Nov 2004 14:01:50 -0600, ICSAnalyst
wrote:


The code doesnt work because it loops and doesn't stop unless i hit
ctrl- break. not sure how to change.




  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Creating a Macro that will Delete if anything less than 20%


Copy and paste this into a macro and run it

Sub delete_rows()
Dim RowNdx As Long
Dim LastRow As Long
LastRow = ActiveSheet.Cells(Rows.Count, "H").End(xlUp).Row
For RowNdx = LastRow To 1 Step -1
If Cells(RowNdx, "H").Value <= 20 Then
Rows(RowNdx).Delete
End If
Next RowNdx
End Su

--
scottymellot
-----------------------------------------------------------------------
scottymelloty's Profile: http://www.excelforum.com/member.php...nfo&userid=380
View this thread: http://www.excelforum.com/showthread.php?threadid=27716

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 sheets from a workbook without creating linked formulae BlueTig Excel Discussion (Misc queries) 3 August 23rd 06 08:39 AM
delete a macro that isn't in macro list Jane Makinson Excel Discussion (Misc queries) 3 March 13th 06 01:10 PM
How can I delete a macro when the Delete button is not active? FCR Excel Worksheet Functions 0 March 9th 06 09:43 AM
How do i delete a macro in Excel 2003 when delete isn't highlight Abel Excel Discussion (Misc queries) 2 September 13th 05 04:09 AM
macro to delete entire rows when column A is blank ...a quick macro vikram Excel Programming 4 May 3rd 04 08:45 PM


All times are GMT +1. The time now is 02:09 AM.

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

About Us

"It's about Microsoft Excel"