s.schwantes
01-12-2015, 07:12 PM
It keeps blowing up on line 2 ... If. Range
Also posted here:
http://www.mrexcel.com/forum/newthread.php?do=newthread&f=10
http://answers.microsoft.com/en-us/office/forum/office_2010-customize/whats-wrong-with-this-code/334e54af-f676-48f8-bb11-38f62ca4a464?tm=1421114858685
thanks in advance!
Steve
Sub Reporting_If_No()
ActiveSheet.Select
If .Range("$B$14") = "No" Then
'PART 1
Application.Goto Reference:="RR_Table_Copy"
Selection.Copy
Sheets("Rankin Report 1 - Summary").Select
Columns("E:F").Select
Selection.Insert Shift:=xlToRight
Range("E1:F28").Select
Selection.PasteSpecial Paste:=xlPasteFormats, Operation:=xlNone, _
SkipBlanks:=False, Transpose:=False
ActiveSheet.Paste Link:=True
Application.CutCopyMode = False
'cut two lines - see notepad
Range("F1,F5,F8,F9").Select
Selection.ClearContents
Range("E26:F26").Select
Application.CutCopyMode = False
Selection.Style = "Percent"
'PART 2
Sheets("Rankin Report 2 - Detail").Select
Columns("C").Select
Selection.Insert Shift:=xlToRight
Range("C128").Select
Selection.PasteSpecial Paste:=xlPasteFormats, Operation:=xlNone, _
SkipBlanks:=False, Transpose:=False
ActiveSheet.Paste Link:=True
Application.CutCopyMode = False
'cut two lines - see notepad
Range("D1,D5,D8,F9").Select
Selection.ClearContents
Range("C2626").Select
Application.CutCopyMode = False
Selection.Style = "Percent"
' End Test
' auto fit all columns
Cells.Select
Cells.EntireColumn.AutoFit
End If
' return user to Calculator sheet
End Sub
Also posted here:
http://www.mrexcel.com/forum/newthread.php?do=newthread&f=10
http://answers.microsoft.com/en-us/office/forum/office_2010-customize/whats-wrong-with-this-code/334e54af-f676-48f8-bb11-38f62ca4a464?tm=1421114858685
thanks in advance!
Steve
Sub Reporting_If_No()
ActiveSheet.Select
If .Range("$B$14") = "No" Then
'PART 1
Application.Goto Reference:="RR_Table_Copy"
Selection.Copy
Sheets("Rankin Report 1 - Summary").Select
Columns("E:F").Select
Selection.Insert Shift:=xlToRight
Range("E1:F28").Select
Selection.PasteSpecial Paste:=xlPasteFormats, Operation:=xlNone, _
SkipBlanks:=False, Transpose:=False
ActiveSheet.Paste Link:=True
Application.CutCopyMode = False
'cut two lines - see notepad
Range("F1,F5,F8,F9").Select
Selection.ClearContents
Range("E26:F26").Select
Application.CutCopyMode = False
Selection.Style = "Percent"
'PART 2
Sheets("Rankin Report 2 - Detail").Select
Columns("C").Select
Selection.Insert Shift:=xlToRight
Range("C128").Select
Selection.PasteSpecial Paste:=xlPasteFormats, Operation:=xlNone, _
SkipBlanks:=False, Transpose:=False
ActiveSheet.Paste Link:=True
Application.CutCopyMode = False
'cut two lines - see notepad
Range("D1,D5,D8,F9").Select
Selection.ClearContents
Range("C2626").Select
Application.CutCopyMode = False
Selection.Style = "Percent"
' End Test
' auto fit all columns
Cells.Select
Cells.EntireColumn.AutoFit
End If
' return user to Calculator sheet
End Sub