Hi
How can I delete the entire rows if 'Null Values' are encountered in the cell of column C:C.
e.g. c15, c18,c29, c32-34 etc
Advance thanks for your help
Hi
How can I delete the entire rows if 'Null Values' are encountered in the cell of column C:C.
e.g. c15, c18,c29, c32-34 etc
Advance thanks for your help
![]()
Please Login or Register to view this content.
Last edited by JieJenn; 02-18-2013 at 01:45 PM.
Public Sub RemoveBlanks()
Dim rng As Excel.Range
Dim rw As Excel.Range
Set rng = ThisWorkbook.Worksheets("Sheet2").Range("C:C")
For Each rw In rng.Rows
If rw.Cells(1, 1).Value = "" Or Asc(rw.Cells(1, 1)) = 13 Then
rw.Delete
End If
Next rw
End Sub
nathansav,
Your post does not comply with Rule 3 of our Forum RULES. Use code tags around code.
Posting code in [CODE]Please [url=https://www.excelforum.com/login.php]Login or Register [/url] to view this content.[/CODE] tags makes your code much easier to read and copy for testing, it also maintains VBA formatting.
Highlight your code and click the # icon at the top of your post window. More information about these and other tags can be found here
If I have helped, Don't forget to add to my reputation (click on the star below the post)
Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)
Use code tags when posting your VBA code: [code] Your code here [/code]
another
![]()
Please Login or Register to view this content.
Thanks,
Mike
If you are satisfied with the solution(s) provided, please mark your thread as Solved.
Select Thread Tools-> Mark thread as Solved.
Dear nathansav & Jen,
Thanks for your quick response.
I have used the macro but still so many blank cells are there in column 'C'.
May I request you to check in my attached spreadsheet as I m still so many cells with null value
Thank you very much Mike. Its working perfectly now.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks