How can i remove Formula from Excel Blank Cell, For Example i have these formula in one of the Blank Cells in Excel Dynamically.
=IF('filepath[filename.xls]Sheet1'!$A$1:A$65536="","",'filepath[filename.xls]Sheet1'!$A$1:A$65536)
.
Thanks
This will be some simple macro as:
Sub Macro1()
For Each c In Worksheets("your sheet name").Range("your range")
If c.Value = "" Then c.Select: Selection.ClearContents
Next c
End Sub
Where "your sheet name" can be for example "Sheet1"
and "your range" can be for example "a1:a10"
Private Sub Worksheet_Calculate()
Dim cell As Range
On Error GoTo finish
Application.EnableEvents = False
For Each cell In UsedRange
If cell.Text = "" Then cell.Clear
Next
finish:
Application.EnableEvents = True
End Sub
Unfortunately there is no way for Excel to provide a truly empty cell if it contains a formula, but I have a way to empty the cells:
Create an if statement that, if false, returns ERROR.TYPE(1)
.
From there, select the range of cells you want to delete the intended "blanks" from and use "Find and Select" >> "Go to Special" .
Click on the "Formulas" radio button and leave "Errors" as the only box checked . Clicking OK will highlight all the cells that were assigned the value "#N/A" .
Now just press the delete key.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.