Blockhead15
New Member
- Joined
- Jun 13, 2022
- Messages
- 17
- Office Version
- 365
- Platform
- Windows
Right now, my code (shown below) applies a formula to column D for all rows. Is there a way to only show the formula if column c <> blank?
Formula = "=if(sum(F8:xx8)<>E8,""Check"","""")"
Set Rng = Range("d8:xx" & lastr)
Rng.Cells(1, 3).Formula = Formula
Rng.Cells(1, 3).Copy
For i = 1 To lastr - 6
Rng.Cells(i, 1 + 1).PasteSpecial Paste:=xlPasteFormulas
Next i
A | B | C | D | E | F | G | |||||||||||||||
|
| ||||||||||||||||||||
Section 1 |
|
|
|
| |||||||||||||||||
A | Part A | ||||||||||||||||||||
1 | Part A | (657,905,844) | (126,690,984) | (531,214,860) | |||||||||||||||||
2 | Part B | 722,544,257 | 139,138,212 | 583,406,045 | |||||||||||||||||
3 | Subtotal | Check | 64,638,413 | 64,638,413 | 64,638,413 | ||||||||||||||||
B | Part B | ||||||||||||||||||||
1 | Part G | Check | 64,638,413 | 64,638,413 | 64,638,413 | ||||||||||||||||
2 | Part H | 0 | 0 | 0 | |||||||||||||||||
3 | Part I | 0 | 0 | 0 | |||||||||||||||||
4 | SubTotal | Check | 64,638,413 | 64,638,413 | 64,638,413 |
Formula = "=if(sum(F8:xx8)<>E8,""Check"","""")"
Set Rng = Range("d8:xx" & lastr)
Rng.Cells(1, 3).Formula = Formula
Rng.Cells(1, 3).Copy
For i = 1 To lastr - 6
Rng.Cells(i, 1 + 1).PasteSpecial Paste:=xlPasteFormulas
Next i