Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Excel "Move or Copy" and "Delete" sheet functions | Excel Worksheet Functions | |||
How do you select line or columns in "Line-Column on 2 axes" graphs? | Excel Discussion (Misc queries) | |||
Delete the number "49" from each cell in a column | Excel Worksheet Functions | |||
test for minimum #, exlude line with "x" in a column. | Excel Discussion (Misc queries) | |||
Adding "New" "Insert" "Delete" into a workbook to change from data 1 to data 2 etc | Excel Programming |