User Tools

Site Tools


microsoft_excel:macro_change_formulae

This is an old revision of the document!


Microsoft Excel - Macro Change formulae

' Change for formula in column E to add 1 to the date.  This should make dates that are the last day of the month now reflect
' the 1st of the following month.
 
.Range("E" & i).Formula = "=TEXT(TEXT(MID(F" & i & ",FIND("" "",F" & i & ")+1,FIND("","",F" & i & ")-FIND("" "",F" & i & ")-1)&"" ""&LEFT(F" & i & ",FIND("" "",F" & i & ")-1)&"" ""&RIGHT(F" & i & ",4),""dd/mm/yyyy"")+1,""dd/mm/yyyy"")"
 
.Range("A" & i & ":C" & i).Formula = .Range("A2:C2").FormulaR1C1
.Range("A" & i & ":C" & i).Calculate
 
.Range("K" & i & ":N" & i).Formula = .Range("K2:N2").FormulaR1C1
.Range("K" & i & ":N" & i).Calculate
 
.Range("AI" & i & ":AM" & i).Formula = .Range("AI2:AM2").FormulaR1C1
.Range("AI" & i & ":AM" & i).Calculate
 
.Range("AR" & i & ":AT" & i).Formula = .Range("AR2:AT2").FormulaR1C1
.Range("AR" & i & ":AT" & i).Calculate
microsoft_excel/macro_change_formulae.1594805433.txt.gz · Last modified: 2020/07/15 09:30 by 127.0.0.1

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki