Clear Content of blank cells in a column

ActorExcelChamp12

New Member
Joined
Aug 11, 2021
Messages
5
Office Version
  1. 2019
I want to clear content of blank cells (equal to "") from column C of "Sheet2".
The column has header rows till row 5 - so any blank cell below row 5 I want to clear content. The no. of rows may vary each time.

Please could someone help.
 

Excel Facts

How can you turn a range sideways?
Copy the range. Select a blank cell. Right-click, Paste Special, then choose Transpose.
I want to clear content of blank cells (equal to "") from column C of "Sheet2".
The column has header rows till row 5 - so any blank cell below row 5 I want to clear content. The no. of rows may vary each time.

Please could someone help.
I am looking for a simple VBA code to do this. Thanks
 
Upvote 0
Do you mean that col C has a formula & if it returns "" then remove the formula?
 
Upvote 0
Do you mean that col C has a formula & if it returns "" then remove the formula?
Yes that's correct. When I run Isblank() to cells with "" it is coming back as false. I want to ensure cells are truly blank by clearing the content
 
Upvote 0
Ok, how about
VBA Code:
Sub ActorExcel()
   Dim Cl As Range
   For Each Cl In Range("C6", Range("C" & Rows.Count).End(xlUp))
      If Cl.Value = "" Then Cl.ClearContents
   Next Cl
End Sub
 
Upvote 0
Ok, how about
VBA Code:
Sub ActorExcel()
   Dim Cl As Range
   For Each Cl In Range("C6", Range("C" & Rows.Count).End(xlUp))
      If Cl.Value = "" Then Cl.ClearContents
   Next Cl
End Sub
Thanks how do I ensure this VBA code looks at Sheet2 rather than Sheet1 in the active workbook?
 
Upvote 0
How about
VBA Code:
Sub ActorExcel()
   Dim Cl As Range
   With Sheets("Sheet2")
      For Each Cl In .Range("C6", .Range("C" & Rows.Count).End(xlUp))
         If Cl.Value = "" Then Cl.ClearContents
      Next Cl
   End With
End Sub
 
Upvote 0
Solution
How about
VBA Code:
Sub ActorExcel()
   Dim Cl As Range
   With Sheets("Sheet2")
      For Each Cl In .Range("C6", .Range("C" & Rows.Count).End(xlUp))
         If Cl.Value = "" Then Cl.ClearContents
      Next Cl
   End With
End Sub
Thanks so much. Have a great day :) :)
 
Upvote 0
You're welcome & thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,214,646
Messages
6,120,718
Members
448,986
Latest member
andreguerra

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top