Macro/VBA Error Message

dj1cincy

New Member
Joined
Nov 24, 2017
Messages
3
I have been running this spreadsheet with the current macro "Outliers" for the last several months. I was using an older version of excel (1997 - 2003). The macro has worked fine. I just upgraded to Office 365 and saved the current workbook as an "Excel Macro-Enabled Workbook. Since I made this change, I get an error when I run the macro "Outliers". The line of code that is in error is indicated in red. Can anyone assist with this?


Sub Outliers()
'
' Outliers Macro
' Macro recorded 4/11/2017 by KDG User
'


'
Columns("N:N").Select
Selection.Insert Shift:=xlToRight, CopyOrigin:=xlFormatFromLeftOrAbove
Range("N15").Select
ActiveCell.FormulaR1C1 = "Non Outliers"
With ActiveCell.Characters(Start:=1, Length:=12).Font
.Name = "Arial"
.FontStyle = "Bold"
.Size = 10
.Strikethrough = False
.Superscript = False
.Subscript = False
.OutlineFont = False
.Shadow = False
.Underline = xlUnderlineStyleNone
.ColorIndex = 1
End With
Range("N16").Select
Application.WindowState = xlNormal
Application.Left = 502
Application.Top = 70.75
ActiveWindow.ScrollColumn = 2
ActiveWindow.ScrollColumn = 3
ActiveWindow.ScrollColumn = 4
ActiveWindow.ScrollColumn = 5
ActiveWindow.ScrollColumn = 6
ActiveWindow.ScrollColumn = 7
ActiveWindow.ScrollColumn = 8
ActiveWindow.ScrollColumn = 9
ActiveWindow.ScrollColumn = 10
Range("N16").Select
ActiveCell.FormulaR1C1 = "=IF(AND(RC[-1]>R3C3,RC[-1]<r4c3),rc[-1],"" "")"
Range("N17").Select
Application.WindowState = xlMaximized
Range("N16").Select
Selection.Copy
Range("N17:N100").Select
ActiveSheet.Paste
Application.CutCopyMode = False

Range("G2").Select
ActiveCell.FormulaR1C1 = "=AVERAGE(R[14]C[7]:R[98]C[7])"
Range("G2").Select

Range("A1").Select
End Sub





</r4c3),rc[-1],"">
 

Excel Facts

Why does 9 mean SUM in SUBTOTAL?
It is because Sum is the 9th alphabetically in Average, Count, CountA, Max, Min, Product, StDev.S, StDev.P, Sum, VAR.S, VAR.P.
how are you clarifying to excel which worksheet you expect this to run on
 
Upvote 0

Forum statistics

Threads
1,223,911
Messages
6,175,324
Members
452,635
Latest member
laura12345

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top