I just figured I'd post my solution (and a better description of my
problem) in case anyone was interested.
I am doing a monthly reconciliation whereby I add up multiple values
in 2 columns (debits and credits) in a separate spreadsheet. For
example, cell a2 (the debits) would equal "=123+345" and b2 (the
credits) would equal "=567+789" when I'm done with the rec. Once I
verify that the rec. works, I then go back to my rec and copy the
values of a2 and b2 into 1 formula on my reconciliation. so the
corresponding cell on my rec would equal =(123+345)-(567+789). I know
there are better ways to do this but most would require me re-writing
the spreadsheet and since there are other people that use this file -
this appears to be the path of least resistance.
Either way... .here's my solution:
Sub CombineFormulas()
'Application.ScreenUpdating = False
If Selection.Columns.Count <> 1 Then
MsgBox "Macro only works if you select 1 column. Please select
1 column and re-run macro", vbCritical
Exit Sub
End If
For Each Cell In Selection
Formula1 =
WorksheetFunction.Substitute(WorksheetFunction.Substitute(Cell.Formula,
"'", ""), "=", "")
Formula2 =
WorksheetFunction.Substitute(WorksheetFunction.Substitute(Cell.Offset(0,
1).Formula, "'", ""), "=", "")
Cell2 = Cell.Offset(0, 2).Select
ActiveCell.FormulaR1C1 = "=(" & Formula1 & ")-(" & Formula2 &
")"
Next
End Sub