PC Review


Reply
Thread Tools Rate Thread

Delete rows depending on cell Value

 
 
=?Utf-8?B?VG9tYXMgU3Ryb2Vt?=
Guest
Posts: n/a
 
      8th Jun 2007
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 With Quote
 
 
 
 
Norman Jones
Guest
Posts: n/a
 
      8th Jun 2007
Hi Tomas,

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


---
Regards,
Norman


"Tomas Stroem" <(E-Mail Removed)> wrote in message
news:75A821CD-920F-4941-B923-(E-Mail Removed)...
> 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 With Quote
 
=?Utf-8?B?VG9tYXMgU3Ryb2Vt?=
Guest
Posts: n/a
 
      8th Jun 2007
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" <(E-Mail Removed)> wrote in message
> news:75A821CD-920F-4941-B923-(E-Mail Removed)...
> > 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 With Quote
 
=?Utf-8?B?TWlrZSBI?=
Guest
Posts: n/a
 
      8th Jun 2007
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" <(E-Mail Removed)> wrote in message
> > news:75A821CD-920F-4941-B923-(E-Mail Removed)...
> > > 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 With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
skip rows depending value of a particular cell in that row Prema Microsoft Excel Programming 3 20th Nov 2008 04:10 PM
delete the non blank rows depending on Column Harn88 Microsoft Excel Programming 1 18th Nov 2008 08:37 AM
Concatenate Rows depending on cell value in rows Pman Microsoft Excel Programming 1 9th Feb 2008 10:33 PM
Delete variable # of rows depending on conditions =?Utf-8?B?UG1hbg==?= Microsoft Excel Programming 5 27th Sep 2007 03:27 PM
How to delete a set of rows depending on Value =?Utf-8?B?bXNidXR0b24yNw==?= Microsoft Excel Misc 1 15th Jan 2006 04:57 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 07:10 PM.