ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Delete rows if AF and AY empty but F has information (https://www.excelbanter.com/excel-worksheet-functions/258021-delete-rows-if-af-ay-empty-but-f-has-information.html)

Louie

Delete rows if AF and AY empty but F has information
 
I am looking for help getting a macro that works and performs the following
steps.

Check Column F for information
If Column F has information check Column AF and AY for information
If Column AF and AY are empty delete the rows.

Can you help?

Louie

SOLVED Delete rows if AF and AY empty but F has information
 
Please disregard this post. I posted in wrong section.

"Louie" wrote:

I am looking for help getting a macro that works and performs the following
steps.

Check Column F for information
If Column F has information check Column AF and AY for information
If Column AF and AY are empty delete the rows.

Can you help?


Gord Dibben

Delete rows if AF and AY empty but F has information
 
Sub deleterows()
Dim iLastRow As Long
Dim i As Long

iLastRow = Cells(Rows.Count, "F").End(xlUp).Row
For i = iLastRow To 1 Step -1
If Cells(i, "F").Value < "" Then
If Application.CountA(Range(Cells(i, "AF"), _
Cells(i, "AY"))) = 0 Then
Rows(i).Delete
End If
End If
Next i

End Sub


Gord Dibben MS Excel MVP


On Thu, 4 Mar 2010 10:13:01 -0800, Louie
wrote:

I am looking for help getting a macro that works and performs the following
steps.

Check Column F for information
If Column F has information check Column AF and AY for information
If Column AF and AY are empty delete the rows.

Can you help?



Gord Dibben

SOLVED Delete rows if AF and AY empty but F has information
 
Too late Louie.


Gord Dibben MS Excel MVP

On Thu, 4 Mar 2010 10:48:01 -0800, Louie
wrote:

Please disregard this post. I posted in wrong section.

"Louie" wrote:

I am looking for help getting a macro that works and performs the following
steps.

Check Column F for information
If Column F has information check Column AF and AY for information
If Column AF and AY are empty delete the rows.

Can you help?



Louie

Delete rows if AF and AY empty but F has information
 
Hi Gord thanks for the help. Its not working completely. Any thoughts?

Also, I am not sure if you saw my earlier post regarding this question.
After I realized I posted this question in the worksheet section, I left a
message to ignore this post, and I reposted in the programming section. The
title is 'Info in F but AF and/or AY no info so delete the..' but the
question is the same. My name is Louie, if you search by that display name
you will see the other post. Please reply wherever is more convenient for
you.

Thanks again for your help.

"Gord Dibben" wrote:

Sub deleterows()
Dim iLastRow As Long
Dim i As Long

iLastRow = Cells(Rows.Count, "F").End(xlUp).Row
For i = iLastRow To 1 Step -1
If Cells(i, "F").Value < "" Then
If Application.CountA(Range(Cells(i, "AF"), _
Cells(i, "AY"))) = 0 Then
Rows(i).Delete
End If
End If
Next i

End Sub


Gord Dibben MS Excel MVP


On Thu, 4 Mar 2010 10:13:01 -0800, Louie
wrote:

I am looking for help getting a macro that works and performs the following
steps.

Check Column F for information
If Column F has information check Column AF and AY for information
If Column AF and AY are empty delete the rows.

Can you help?


.


Louie

Delete rows if AF and AY empty but F has information
 
Miscommunication on my part. That's why its not working. Sorry Gord, i am
looking for "and/or", just ignore this post completely. My apologies.

"Louie" wrote:

Hi Gord thanks for the help. Its not working completely. Any thoughts?

Also, I am not sure if you saw my earlier post regarding this question.
After I realized I posted this question in the worksheet section, I left a
message to ignore this post, and I reposted in the programming section. The
title is 'Info in F but AF and/or AY no info so delete the..' but the
question is the same. My name is Louie, if you search by that display name
you will see the other post. Please reply wherever is more convenient for
you.

Thanks again for your help.

"Gord Dibben" wrote:

Sub deleterows()
Dim iLastRow As Long
Dim i As Long

iLastRow = Cells(Rows.Count, "F").End(xlUp).Row
For i = iLastRow To 1 Step -1
If Cells(i, "F").Value < "" Then
If Application.CountA(Range(Cells(i, "AF"), _
Cells(i, "AY"))) = 0 Then
Rows(i).Delete
End If
End If
Next i

End Sub


Gord Dibben MS Excel MVP


On Thu, 4 Mar 2010 10:13:01 -0800, Louie
wrote:

I am looking for help getting a macro that works and performs the following
steps.

Check Column F for information
If Column F has information check Column AF and AY for information
If Column AF and AY are empty delete the rows.

Can you help?


.


Gord Dibben

Delete rows if AF and AY empty but F has information
 
Change the = 0 to < 2

If Application.CountA(Range(Cells(i, "AF"), _
Cells(i, "AY"))) = 0 Then


Gord

On Thu, 4 Mar 2010 12:39:02 -0800, Louie
wrote:

Hi Gord thanks for the help. Its not working completely. Any thoughts?

Also, I am not sure if you saw my earlier post regarding this question.
After I realized I posted this question in the worksheet section, I left a
message to ignore this post, and I reposted in the programming section. The
title is 'Info in F but AF and/or AY no info so delete the..' but the
question is the same. My name is Louie, if you search by that display name
you will see the other post. Please reply wherever is more convenient for
you.

Thanks again for your help.

"Gord Dibben" wrote:

Sub deleterows()
Dim iLastRow As Long
Dim i As Long

iLastRow = Cells(Rows.Count, "F").End(xlUp).Row
For i = iLastRow To 1 Step -1
If Cells(i, "F").Value < "" Then
If Application.CountA(Range(Cells(i, "AF"), _
Cells(i, "AY"))) = 0 Then
Rows(i).Delete
End If
End If
Next i

End Sub


Gord Dibben MS Excel MVP


On Thu, 4 Mar 2010 10:13:01 -0800, Louie
wrote:

I am looking for help getting a macro that works and performs the following
steps.

Check Column F for information
If Column F has information check Column AF and AY for information
If Column AF and AY are empty delete the rows.

Can you help?


.




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

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com