I am sure this is far easier than I am making it. I hope someone out there can just tell me why this isn't working. I want to create two macros for this spreadsheet. They should be fairly easy but I can't seem to get them to work. This is sort of a checkbook balance that our facilties/centers will use each month. I want one macro to insert a new row and add the formulas to that row.The other needs to delete a row and adjust the formulas. My problem is that the formulas that I have are dependant on the row above it. (For example, in G17 the formula should be =SUM(G16-E17+E18) I need to have the formulas below the insertion or deletion updated. I have tried just recording the macro but the formulas change when they are copied. I tried using the relative references but that doesn't work either. I tried the code that was put out in August(I think it was Aug.) but that didn't help either. What am I missing?? I apologize if I missed something that would answer my question. I am such a NEWBIE!!
I'm using Windows 2000 and Excel XP.
Thanks in advance.
Here are my two attempts.
Macro recorded 11/30/2004
ActiveSheet.Unprotect
Selection.End(xlToLeft).Select
Selection.EntireRow.Insert
ActiveCell.FormulaR1C1 = "=SUM(R[-1]C+1)"
ActiveCell.Offset(0, 6).Range("A1").Select
ActiveCell.FormulaR1C1 = "=SUM(R[-1]C-RC[-1]+RC[-1])"
ActiveSheet.protect DrawingObjects:=True, Contents:=True, Scenarios:=True
End Sub
Sub Delete()
' Delete Macro
' Macro recorded 11/30/2004
ActiveSheet.Unprotect
Selection.End(xlToLeft).Select
ActiveCell.Range("A1:F1").Select
Selection.Delete Shift:=xlUp
Selection.End(xlToLeft).Select
ActiveCell.Offset(-1, 0).Range("A1").Select
Selection.copy
ActiveCell.Offset(1, 0).Range("A1").Select
ActiveSheet.Paste
ActiveCell.Offset(0, 6).Range("A1").Select
ActiveCell.FormulaR1C1 = "=SUM(R[-1]C-RC[-2]+RC[-1])"
Selection.End(xlDown).Select
Selection.ClearContents
Selection.ClearFormats
ActiveCell.Offset(-1, 0).Range("A1").Select
Selection.End(xlUp).Select
ActiveCell.Offset(1, -5).Range("A1").Select
ActiveSheet.protect DrawingObjects:=True, Contents:=True, Scenarios:=True
End Sub