McM_
New Member
- Joined
- Oct 23, 2023
- Messages
- 23
- Office Version
- 365
- Platform
- Windows
Hello, please, a code that automatically activates the formulas in the sheet, without the need to activate Macros with F5. In Example 1 I took a simple formula just to see the code that automatically activates the formulas in the sheet.
In examples 2 and 3, I have codes that are automatically activated in the sheet when a condition is met.
Thank you!
In examples 2 and 3, I have codes that are automatically activated in the sheet when a condition is met.
Thank you!
VBA Code:
Sub Formula()
'I want this code to run without F5
Range("C2:C8").Select
ActiveCell.FormulaR1C1 = "=IF(RC[-2]>0,(RC[-2]+RC[-1]),"""")"
Range("C2:C8").Select
Range("C3").Activate
End Sub
Private Sub worksheet_Change(ByVal Target As Range)
Dim ws As Worksheet
'activation without F5
If Target.Column = 8 Then
Range("I" & Target.Row) = Now
End If
If Target.Column = 14 Then
Range("M3:M" & Target.Row) = Range("L3")
End If
End Sub