Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Delete line if value in column C = ""

Good day,

I have three columns of data in A, B & C. Data exists in column A & B
but in some cells in column C there is no data. I want to delete th
entire row if no data is found in column C. I have very limite
experience in writing macro's. I am wondering if someone can draw u
how I can get this started. The range of the data is from A2:C500.

Thanks for any help

--
Message posted from http://www.ExcelForum.com

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 14
Default Delete line if value in column C = ""

Hi !

The following code should do the trick:


Sub DeleteEmptyC()

Dim Row As Long
Dim EndRow As Long

Row = 2
EndRow = 500


Do While Row <= EndRow

If IsEmpty(Cells(Row, 3)) Then
Rows(Row).Select
Selection.Delete Shift:=xlUp
'Subtract 1 from Row and EndRow for every row deleted
Row = Row - 1
EndRow = EndRow - 1
End If

Row = Row + 1
Loop

End Sub


Good luck

"TheLeafs " wrote in message
...
Good day,

I have three columns of data in A, B & C. Data exists in column A & B,
but in some cells in column C there is no data. I want to delete the
entire row if no data is found in column C. I have very limited
experience in writing macro's. I am wondering if someone can draw up
how I can get this started. The range of the data is from A2:C500.

Thanks for any help.


---
Message posted from http://www.ExcelForum.com/



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 70
Default Delete line if value in column C = ""

Grüezi TheLeafs

TheLeafs schrieb am 23.06.2004

I have three columns of data in A, B & C. Data exists in column A & B,
but in some cells in column C there is no data. I want to delete the
entire row if no data is found in column C. I have very limited
experience in writing macro's. I am wondering if someone can draw up
how I can get this started. The range of the data is from A2:C500.


Use the following line:

Range("C:C").SpecialCells(xlCellTypeBlanks).Entire Row.Delete

--
Regards

Thomas Ramel
- MVP for Microsoft-Excel -

[Win XP Pro SP-1 / xl2000 SP-3]
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 22,906
Default Delete line if value in column C = ""

If you don't need to use a macro try this.

Select Column C and EditGo ToSpecialBlanksOK

With all blanks in C selected......

EditDeleteEntire Row.

If you recorded a macro while doing it, you would get basically the same code
as Thomas posted. He has removed a few "select" statements.

Gord Dibben Excel MVP

On Wed, 23 Jun 2004 10:26:31 -0500, TheLeafs
wrote:

Good day,

I have three columns of data in A, B & C. Data exists in column A & B,
but in some cells in column C there is no data. I want to delete the
entire row if no data is found in column C. I have very limited
experience in writing macro's. I am wondering if someone can draw up
how I can get this started. The range of the data is from A2:C500.

Thanks for any help.


---
Message posted from http://www.ExcelForum.com/


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
Excel "Move or Copy" and "Delete" sheet functions dsiama Excel Worksheet Functions 1 December 28th 07 01:57 PM
How do you select line or columns in "Line-Column on 2 axes" graphs? mizterbusy Excel Discussion (Misc queries) 0 September 19th 06 06:48 AM
Delete the number "49" from each cell in a column se12 Excel Worksheet Functions 18 September 5th 06 05:53 PM
test for minimum #, exlude line with "x" in a column. nastech Excel Discussion (Misc queries) 1 August 9th 06 11:26 AM
Adding "New" "Insert" "Delete" into a workbook to change from data 1 to data 2 etc Bob Reynolds[_2_] Excel Programming 0 March 4th 04 08:52 PM


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