Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
The code below works, but I'm sure it can be simplified. Any help would be
appreciated. Am using this project to help me learn VBA. Sub Populate_Charts() 'This Populates the Chart with the Week Ending Dates from the Pivot Table Worksheets("Pivot").Activate Range("B4").Activate Range(ActiveCell, ActiveCell.End(xlToRight)).Copy Worksheets("Charts").Activate Range("C25").PasteSpecial Paste:=xlValues, Operation:=xlNone, SkipBlanks:= _ False, Transpose:=False Rows("25:25").Select Selection.NumberFormat = "d-mmm-yy" 'This Populates the Chart with Average Planned Manpower Worksheets("Pivot").Activate Range("B10").Activate Range(ActiveCell, ActiveCell.End(xlToRight)).Copy Worksheets("Charts").Activate Range("C26").PasteSpecial Paste:=xlValues, Operation:=xlNone, SkipBlanks:= _ False, Transpose:=False Selection.NumberFormat = "#,##0.0" Worksheets("Pivot").Activate Range("B5:B5").Activate Range(ActiveCell, ActiveCell.End(xlToRight)).Copy Worksheets("Charts").Activate Range("C28:C28").PasteSpecial Paste:=xlValues, Operation:=xlNone, SkipBlanks:= _ False, Transpose:=False Selection.NumberFormat = "0.0%" Worksheets("Pivot").Activate Range("B6:B6").Activate Range(ActiveCell, ActiveCell.End(xlToRight)).Copy Worksheets("Charts").Activate Range("C29:C29").PasteSpecial Paste:=xlValues, Operation:=xlNone, SkipBlanks:= _ False, Transpose:=False Selection.NumberFormat = "0.0%" ActiveCell.CurrentRegion.Select Selection.Borders(xlEdgeLeft).Weight = xlThin Selection.Borders(xlEdgeRight).Weight = xlThin Selection.Borders(xlEdgeTop).Weight = xlThin Selection.Borders(xlEdgeBottom).Weight = xlThin Selection.Borders(xlInsideHorizontal).Weight = xlThin Selection.Borders(xlInsideVertical).Weight = xlThin End Sub |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
split post code (zip code) out of cell that includes full address | Excel Discussion (Misc queries) | |||
Code to conditional format all black after date specified in code? | Excel Discussion (Misc queries) | |||
Drop Down/List w/Code and Definition, only code entered when selec | Excel Worksheet Functions | |||
option buttons run Click code when value is changed via VBA code | Excel Programming | |||
VBA code delete code but ask for password and unlock VBA protection | Excel Programming |