Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 55
Default Write a bsice macro

Hello,

I would like the code for a macro that does the following:
I have a spreadsheet with a header row and want to delete any rows that have
a number in columns 3,4, or 5 that is less than 70

--
Mike B
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,337
Default Write a bsice macro

see my answer to your previous post. change to 3 step -1 to to 2 step -1

--
Don Guillett
SalesAid Software

"mike b" wrote in message
...
Hello,

I would like the code for a macro that does the following:
I have a spreadsheet with a header row and want to delete any rows that

have
a number in columns 3,4, or 5 that is less than 70

--
Mike B



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 55
Default Write a bsice macro

Not sure what you meant by what you wrote? change to 3 I assume is column 3.
what does the rest mean?

"Don Guillett" wrote:

see my answer to your previous post. change to 3 step -1 to to 2 step -1

--
Don Guillett
SalesAid Software

"mike b" wrote in message
...
Hello,

I would like the code for a macro that does the following:
I have a spreadsheet with a header row and want to delete any rows that

have
a number in columns 3,4, or 5 that is less than 70

--
Mike B




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,337
Default Write a bsice macro

You posted " Macro syntax - how to find them" and apparently never checked
back for the answer. Here is my original answer modified.

from the bottom up something like

Sub sortanddelete()
ActiveSheet.UsedRange.Sort Key1:=Range("b2"), _
Order1:=xlAscending, Header:=xlYes
For i = Cells(Rows.Count, "b").End(xlUp).Row To 2 Step -1
If Cells(i, 3) < 70 Or Cells(i, 4) < 70 Or Cells(i, 5) < 70 Or _
Cells(i, 6) = "D" Or Cells(i, 7) = "D" Or Cells(i, 8) = "D" Or _
Cells(i, 6) = "E" Or Cells(i, 7) = "E" Or Cells(i, 8) = "E" Or _
Cells(i, 9) < 100 Or Cells(i, 2) = Cells(i - 1, 2) _
Then Rows(i).Delete
Next i
End Sub

--
Don Guillett
SalesAid Software

"mike b" wrote in message
...
Not sure what you meant by what you wrote? change to 3 I assume is column

3.
what does the rest mean?

"Don Guillett" wrote:

see my answer to your previous post. change to 3 step -1 to to 2 step -1

--
Don Guillett
SalesAid Software

"mike b" wrote in message
...
Hello,

I would like the code for a macro that does the following:
I have a spreadsheet with a header row and want to delete any rows

that
have
a number in columns 3,4, or 5 that is less than 70

--
Mike B






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
How to write a macro JStiehl Excel Discussion (Misc queries) 4 August 11th 08 10:08 PM
how do i write a macro AB Excel Worksheet Functions 1 August 17th 06 08:47 PM
Help write Macro nc Excel Discussion (Misc queries) 5 November 17th 05 03:19 PM
is it possible to execute write to the fields in another .xsl form a macro in another .xsl? e.g. some way to load another .xsl into an .xsl macro and write to its data? Daniel Excel Worksheet Functions 1 June 23rd 05 11:38 PM
Need help to write macro please Bob[_57_] Excel Programming 6 May 28th 04 01:21 AM


All times are GMT +1. The time now is 02:11 PM.

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"