Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 26
Default Delete rows depending on cell Value

Hi,

I have a problem to get a macro that deletes rows in a worksheet depending
on the value in row "AB". In the top of the sheet there are headers that i do
not want to test for and at the bottom there are some summary fields that i
do not want to test for either.
The header are always in the same place but the summary fields can vary in
position.

Doe anyone have a good suggestion on how to solve this?
--
Tomas S
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,302
Default Delete rows depending on cell Value

Hi Tomas,

Are the 'summary fields' always found in the last data row?


---
Regards,
Norman


"Tomas Stroem" wrote in message
...
Hi,

I have a problem to get a macro that deletes rows in a worksheet depending
on the value in row "AB". In the top of the sheet there are headers that i
do
not want to test for and at the bottom there are some summary fields that
i
do not want to test for either.
The header are always in the same place but the summary fields can vary in
position.

Doe anyone have a good suggestion on how to solve this?
--
Tomas S



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 26
Default Delete rows depending on cell Value

Norman,
There are three rows with different types of summaries at the bottom. Right
now I have a blank row inserted before the summaries. This blank row is the
first after the ones in the header rows that ever will appear at the time the
macro will be run.
--
Tomas S


"Norman Jones" wrote:

Hi Tomas,

Are the 'summary fields' always found in the last data row?


---
Regards,
Norman


"Tomas Stroem" wrote in message
...
Hi,

I have a problem to get a macro that deletes rows in a worksheet depending
on the value in row "AB". In the top of the sheet there are headers that i
do
not want to test for and at the bottom there are some summary fields that
i
do not want to test for either.
The header are always in the same place but the summary fields can vary in
position.

Doe anyone have a good suggestion on how to solve this?
--
Tomas S




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,501
Default Delete rows depending on cell Value

Thomas,

If I understand correctly you want to read each cell in column AB excluding
the top header rows which are a fixed location and the bottom 4 rows which
are a blank row and 3 rows with data. You then want to delete the entire row
depending on what is in those cells. If this is correct try:-

Sub deleteit()
Dim myrange As Range
lastrowcolab = Range("AB65536").End(xlUp).Row - 4
Set myrange = Range("AB10:A" & lastrowcolab)
For Each c In myrange
c.Select
If c.Value = "Q" Then '<Change to your criteria
Selection.EntireRow.Delete
End If
Next
End Sub

Mike

"Tomas Stroem" wrote:

Norman,
There are three rows with different types of summaries at the bottom. Right
now I have a blank row inserted before the summaries. This blank row is the
first after the ones in the header rows that ever will appear at the time the
macro will be run.
--
Tomas S


"Norman Jones" wrote:

Hi Tomas,

Are the 'summary fields' always found in the last data row?


---
Regards,
Norman


"Tomas Stroem" wrote in message
...
Hi,

I have a problem to get a macro that deletes rows in a worksheet depending
on the value in row "AB". In the top of the sheet there are headers that i
do
not want to test for and at the bottom there are some summary fields that
i
do not want to test for either.
The header are always in the same place but the summary fields can vary in
position.

Doe anyone have a good suggestion on how to solve this?
--
Tomas S




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
adding rows depending on cell value [email protected] Excel Worksheet Functions 1 February 18th 07 05:18 PM
conditional formating on rows & cols depending on one cell bandy2000 Excel Discussion (Misc queries) 1 March 8th 06 12:46 AM
How to delete a set of rows depending on Value msbutton27 Excel Discussion (Misc queries) 1 January 15th 06 05:57 PM
Macro to coppy cells to certain rows depending on value in cell Esrei Excel Discussion (Misc queries) 0 December 9th 05 08:57 AM
Delete row depending on size of Characters in cell CarlJ Excel Programming 2 December 13th 04 07:07 PM


All times are GMT +1. The time now is 08:22 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"