mehidy1437
Active Member
- Joined
- Nov 15, 2019
- Messages
- 348
- Office Version
- 365
- 2016
- 2013
- Platform
- Windows
- Mobile
- Web
Hi Everyone,
I want to check the result of the formula before inserting it into the cell.
If the formula generates a 0, then I don't want to insert the formula into the cell.
How can I do this?
Here is the part of the code, where I want to do this.
I want to check the result of the formula before inserting it into the cell.
If the formula generates a 0, then I don't want to insert the formula into the cell.
How can I do this?
Here is the part of the code, where I want to do this.
VBA Code:
Dim c As Range
For Each c In Rng
If c.MergeCells Then
calSum = c.MergeArea.Offset(, -1).Resize(c.MergeArea.Rows.Count).Address(0, 0)
c.Formula = "=SUM(" & calSum & ")"
End If
Next