Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 40
Default 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?
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 40
Default 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?

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 22,906
Default 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?


  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 22,906
Default 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?


  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 40
Default 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?


.



  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 40
Default 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?


.

  #7   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 22,906
Default 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?


.


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
Hpw do I delete multiple empty rows found between filled rows? Bill Excel Worksheet Functions 2 November 15th 09 07:12 PM
delete empty rows aditya Excel Discussion (Misc queries) 1 June 3rd 09 12:58 PM
Delete Empty Rows JCG Excel Discussion (Misc queries) 4 December 18th 07 11:31 AM
How to Delete empty rows in excel in b/w rows with values Dennis Excel Worksheet Functions 3 August 28th 07 04:15 PM
Cut filtered rows, paste into next empty row of new sheet, and delete cut rows Scott Excel Worksheet Functions 0 December 13th 06 01:25 AM


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