So long story short, this person keeps erasing all the formulas every single time they use the spreadsheet.
How do I take all the column formulas and convert them all into a VBA?
For example, I found this code from Trevor(?)
This was just for R2. What if I have multiple cells with different formulas? How to put them all together easily? I am not very good with VBA as I am still very new. Do I keep adding a new line and add the formula after?
Running that macro record button was just making a bigger mess that I am unable to comprehend as the final result was incredibly long and made no sense to me.
Help please. Thank you.
How do I take all the column formulas and convert them all into a VBA?
For example, I found this code from Trevor(?)
This was just for R2. What if I have multiple cells with different formulas? How to put them all together easily? I am not very good with VBA as I am still very new. Do I keep adding a new line and add the formula after?
VBA Code:
Range("R2").Formula = '(insert formula here)
Running that macro record button was just making a bigger mess that I am unable to comprehend as the final result was incredibly long and made no sense to me.
Help please. Thank you.
VBA Code:
Option Explicit
Sub Macro2()
Dim lngLastRow As Long
lngLastRow = Cells(Rows.Count, "K").End(xlUp).Row
Range("R2").Formula = "=SUM(OFFSET($Q$7,COUNT(K7:K" & lngLastRow & ")-P1,0,P1))/SUM(OFFSET($J$7,COUNT(K7:K" & lngLastRow & ")-P1,0,P1))"
End Sub