Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
adding rows depending on cell value | Excel Worksheet Functions | |||
conditional formating on rows & cols depending on one cell | Excel Discussion (Misc queries) | |||
How to delete a set of rows depending on Value | Excel Discussion (Misc queries) | |||
Macro to coppy cells to certain rows depending on value in cell | Excel Discussion (Misc queries) | |||
Delete row depending on size of Characters in cell | Excel Programming |