PDA

View Full Version : [SOLVED:] Macro to Create Individual Workbook and Remove Colors



Silver
04-24-2015, 11:53 PM
There are 2 sheets - Summary and Report

Report is where the data is maintained on a template .

Since the size of data is large Report sheet is color coded for the agents to work on.
The agents maintain some notes in columns S, T, U, V and W

I need macro to -

1)create an individual workbook of the Report Sheet and rename the workbook and worksheet as Weekly Report 24Apr

2)Since the report is generated on a weekly basis macro should rename the workbook and worksheet when the macro is run

3)Macro should save the individual workbook where the macro workbook is kept

Below is the code which does it -


Sheets("Report").Copy
ActiveSheet.Name = "Weekly Report " & Format(Now, "ddmmm")
ActiveWorkbook.SaveAs Filename:=ThisWorkbook.Path & "\" & "Weekly Report " & Format(Now, "ddmmm") & ".xlsx"

In addition to the above code macro should -

4)Remove colors from the Individual workbook and keep the background color as White

5)Remove notes from the Individual workbook (columns S, T, U, V and W)

What I'm looking for is, when the macro is run it should perform all the activity mentioned in points 1 to 5.

No changes should be done to the Report Sheet.

Attached sample sheet along with the code

p45cal
04-26-2015, 05:18 AM
try:
Sub blah()
Sheets("Report").Copy
With ActiveSheet
.Name = "Weekly Report " & Format(Now, "ddmmm")
With .UsedRange.Interior
.Pattern = xlNone
.TintAndShade = 0
.PatternTintAndShade = 0
End With
.Columns("S:W").ClearContents
End With
ActiveWorkbook.SaveAs Filename:=ThisWorkbook.Path & "\" & "Weekly Report " & Format(Now, "ddmmm") & ".xlsx"
End Sub

Silver
04-26-2015, 07:53 AM
PERFECT...

Thanks for your TIME