Editing exhisting macro

15 pts.
Tags:
Excel macros
Macros
Microsoft Excel
I have an exhisting macro but now I want to delete column's E and H in one of the sheets and am unsure how to edit the macro to correspond to this change.
ASKED: June 7, 2008  7:08 PM
UPDATED: June 9, 2008  2:15 PM

Answer Wiki

Thanks. We'll let you know when a new response is added.

if you are using Excel 2007 click on the View tab of the ribbon, and click the arrow underneath the Macros button on the right and click view View Macros. Select the Macro you want to edit, and select edit.

If you are using Excel 2003 click on Tools, Macros then edit Macros. Select the Macro you want to edit, and select edit.

At this point the macro editor opens and you can edit the macro as needed.

Discuss This Question: 1  Reply

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
  • Cadenthais
    It's like I'm missing something... It should be as simple as deleting two formulas but it's like I'm deleting the wrong thing... The original macro is below. All I am intending to do is delete columns E & H out of the 'month' sheet. I am so stuck. Sub Subtotal() subrownum = ActiveCell.Row Application.ScreenUpdating = True Application.ScreenUpdating = False RowCount = 0 Range("a" & subrownum - 1).Select RowCount = 1 While ActiveCell.Value <> "Date" And ActiveCell.Row > 1 RowCount = RowCount + 1 ActiveCell.Offset(-1, 0).Select Wend Application.ScreenUpdating = True Application.ScreenUpdating = False Range("a" & subrownum).Select Rows(ActiveCell.Row).Select Selection.Insert Shift:=xlDown Range("A" & ActiveCell.Row).Select ActiveCell.Formula = "Subtotal" Range("C" & ActiveCell.Row).Select ActiveCell.Formula = _ "=SUMIF(A" & subrownum - RowCount & ":A" & subrownum - 1 & "," & Chr(34) & _ "<>Subtotal" & Chr(34) & ",C" & subrownum - RowCount & ":C" & subrownum - 1 & ")" Range("E" & ActiveCell.Row).Select ActiveCell.Formula = _ "=SUMIF(A" & subrownum - RowCount & ":A" & subrownum - 1 & "," & Chr(34) & _ "<>Subtotal" & Chr(34) & ",E" & subrownum - RowCount & ":E" & subrownum - 1 & ")" Range("F" & ActiveCell.Row).Select ActiveCell.Formula = _ "=SUMIF(A" & subrownum - RowCount & ":A" & subrownum - 1 & "," & Chr(34) & _ "<>Subtotal" & Chr(34) & ",F" & subrownum - RowCount & ":F" & subrownum - 1 & ")" Range("G" & ActiveCell.Row).Select ActiveCell.Formula = _ "=SUMIF(A" & subrownum - RowCount & ":A" & subrownum - 1 & "," & Chr(34) & _ "<>Subtotal" & Chr(34) & ",g" & subrownum - RowCount & ":g" & subrownum - 1 & ")" Range("h" & ActiveCell.Row).Select ActiveCell.Formula = _ "=SUMIF(A" & subrownum - RowCount & ":A" & subrownum - 1 & "," & Chr(34) & _ "<>Subtotal" & Chr(34) & ",h" & subrownum - RowCount & ":h" & subrownum - 1 & ")" Range("i" & ActiveCell.Row).Select ActiveCell.Formula = _ "=SUMIF(A" & subrownum - RowCount & ":A" & subrownum - 1 & "," & Chr(34) & _ "<>Subtotal" & Chr(34) & ",i" & subrownum - RowCount & ":i" & subrownum - 1 & ")" Range("j" & ActiveCell.Row).Select ActiveCell.Formula = _ "=SUMIF(A" & subrownum - RowCount & ":A" & subrownum - 1 & "," & Chr(34) & _ "<>Subtotal" & Chr(34) & ",j" & subrownum - RowCount & ":j" & subrownum - 1 & ")" Range("k" & ActiveCell.Row).Select ActiveCell.Formula = _ "=SUMIF(A" & subrownum - RowCount & ":A" & subrownum - 1 & "," & Chr(34) & _ "<>Subtotal" & Chr(34) & ",k" & subrownum - RowCount & ":k" & subrownum - 1 & ")" Range("l" & ActiveCell.Row).Select ActiveCell.Formula = _ "=SUMIF(A" & subrownum - RowCount & ":A" & subrownum - 1 & "," & Chr(34) & _ "<>Subtotal" & Chr(34) & ",l" & subrownum - RowCount & ":l" & subrownum - 1 & ")" Range("A" & ActiveCell.Row & ":m" & ActiveCell.Row).Select Range("m" & ActiveCell.Row).Select ActiveCell.Formula = _ "=k" & subrownum & "-L" & subrownum Range("A" & ActiveCell.Row & ":O" & ActiveCell.Row).Select therow = ActiveCell.Row Selection.Font.Bold = True Selection.Borders(xlDiagonalDown).LineStyle = xlNone Selection.Borders(xlDiagonalUp).LineStyle = xlNone With Selection.Borders(xlEdgeLeft) .LineStyle = xlContinuous .Weight = xlThin .ColorIndex = xlAutomatic End With With Selection.Borders(xlEdgeTop) .LineStyle = xlContinuous .Weight = xlThin .ColorIndex = xlAutomatic End With With Selection.Borders(xlEdgeBottom) .LineStyle = xlDouble .Weight = xlThick .ColorIndex = xlAutomatic End With With Selection.Borders(xlEdgeRight) .LineStyle = xlContinuous .Weight = xlThin .ColorIndex = xlAutomatic End With With Selection.Interior .ColorIndex = 15 .Pattern = xlSolid End With Application.ScreenUpdating = False Sheets("Month Summary").Activate Range("E9").Select ActiveCell.Value = Sheets("Month").Range("E" & therow).Value Range("E11").Select ActiveCell.Value = Sheets("Month").Range("F" & therow).Value Range("E13").Select ActiveCell.Value = Sheets("Month").Range("G" & therow).Value Range("E15").Select ActiveCell.Value = Sheets("Month").Range("H" & therow).Value Range("E17").Select ActiveCell.Value = Sheets("Month").Range("I" & therow).Value Range("E19").Select ActiveCell.Value = Sheets("Month").Range("J" & therow).Value Range("c21").Select ActiveCell.Value = Sheets("Month").Range("K" & therow).Value Range("c22").Select ActiveCell.Value = Sheets("Month").Range("L" & therow).Value Application.ScreenUpdating = True Sheets("Month").Activate End Sub
    15 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following