NVIT
asked on
Make sub to format and total ranges
Before.xlsx shows the current state.
After.xlsx shows what I want.
In Before, for User 1, I recorded the macro to make it look like After.
Is there a way to make this more 'generic' so that it runs for the other Users, regardless of how many?
After.xlsx
After.xlsx shows what I want.
In Before, for User 1, I recorded the macro to make it look like After.
Is there a way to make this more 'generic' so that it runs for the other Users, regardless of how many?
Sub Title_And_Total_Group()
Range("A4").Select
Selection.Copy
Range("C3").Select
ActiveSheet.Paste
Application.CutCopyMode = False
Selection.Font.Bold = True
With Selection.Font
.Name = "Calibri"
.Size = 14
.Strikethrough = False
.Superscript = False
.Subscript = False
.OutlineFont = False
.Shadow = False
.Underline = xlUnderlineStyleNone
.ThemeColor = xlThemeColorLight1
.TintAndShade = 0
.ThemeFont = xlThemeFontMinor
End With
Range("F8").Select
ActiveCell.FormulaR1C1 = "=SUM(R[-4]C:R[-1]C)"
Range("F8").Select
Selection.Copy
Range("F8:M8").Select
ActiveSheet.Paste
Selection.Font.Bold = True
Selection.End(xlToLeft).Select
Range("A11").Select
End Sub
Before.xlsxAfter.xlsx
.xlsx can not contain VBA code. You will need to save as .xlsm format
ASKER
I know that. Can you help w/ a macro solution?
Ah. I'll look at it tomorrow AM.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Good point Rgonzo. I missed that.
Thanks for tweaking the code accordingly. :)
Thanks for tweaking the code accordingly. :)
You can get a similar result without VBA and using the Subtotal Wizard or with a slight change to the data format, you could use a Pivot Table.
Thanks
Rob H
Before.xlsx
Thanks
Rob H
Before.xlsx
ASKER
Thank you, Neeraj and Rgonzo!