Thanks for your reply. I put the code you had into my code and here is how part of it looks.
Sheets("Variables").Select range("P1").Select Application.CutCopyMode = False Sheets("Stats").Select range("N2").Select ActiveCell.FormulaR1C1 = "=RC[-8]-(RC[-4]+RC[-3]+RC[-1]+(RC[-5]*R1C9))" range("B42").Select Sheets("Variables").Select range("Q1").Select Sheets("Stats").Select range("O2").Select ActiveCell.FormulaR1C1 = "=RC[-1]/RC[-9]" range("N2").Select Selection.AutoFill Destination:=range(Application.Selection) Selection.AutoFill Destination:=range(Application.Selection.Offset(rowOffset:=0, columnOffset:=1)) Columns("O:O").Select Selection.Style = "Percent" Columns("N:N").Select Selection.NumberFormat = "$#,##0.00_);[Red]($#,##0.00)" Columns("N:N").EntireColumn.AutoFit range("M:M,K:K,J:J,F:F").Select
Application.Selection.Style = "Percent" range("F1").Activate Selection.NumberFormat = "_(* #,##0.00_);_(* (#,##0.00);_(* ""-""??_);_(@_)" Selection.NumberFormat = "_($* #,##0.00_);_($* (#,##0.00);_($* ""-""??_);_(@_)" range("M:M,K:K,J:J,F:F").EntireColumn.AutoFit Cells.Select With Selection .HorizontalAlignment = xlGeneral .WrapText = False .Orientation = 0 .AddIndent = False .IndentLevel = 0 .ShrinkToFit = False .ReadingOrder = xlContext .MergeCells = False End With With Selection .HorizontalAlignment = xlCenter .WrapText = False .Orientation = 0 .AddIndent = False .IndentLevel = 0
I'm not sure what "Application.Selection.Style = "Percent" is for. Am I supposed to put this into the code as above?
Right now I get en error "method 'range' of object '_global' failed.
More help needed. Thanks |