• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

is there a way to combine these 3 macros into one?

sschwant

New Member
here's the code:

Thanks!!

Steve

Sub MacroRR1()
'
With ActiveSheet
If .Range("$B$14") = "No" Then
Application.DisplayAlerts = False
Application.ScreenUpdating = False
Application.Goto Reference:="RR_Table_Copy"
Selection.Copy
Sheets("Rankin Report 1 - Summary").Select
Columns("E:F").Select
Selection.Insert Shift:=xlToRight
Range("E1:F76").Select
ActiveSheet.Paste Link:=True
Selection.PasteSpecial Paste:=xlPasteFormats, Operation:=xlNone, _
SkipBlanks:=False, Transpose:=False
Range("F1").Select
Application.CutCopyMode = False
Selection.ClearContents
Range("F5").Select
Selection.ClearContents
Range("F8").Select
Selection.ClearContents
Cells.Select
Cells.EntireColumn.AutoFit
Range("A1").Select
End If
End With
End Sub

Sub Macro2()

With ActiveSheet
If .Range("$B$14") = "Yes" Then
Application.DisplayAlerts = False
Application.ScreenUpdating = False
Application.Goto Reference:="RR_Table_Copy"
Selection.Copy
Sheets("Rankin Report 2 - Detail").Select
Columns("C:D").Select
Selection.Insert Shift:=xlToRight
Range("C1:D76").Select
ActiveSheet.Paste Link:=True
Selection.PasteSpecial Paste:=xlPasteFormats, Operation:=xlNone, _
SkipBlanks:=False, Transpose:=False
Application.CutCopyMode = False
Range("D5").Select
Selection.ClearContents
Range("D8").Select
Selection.ClearContents
Cells.Select
Cells.EntireColumn.AutoFit
Range("A1").Select
End If
End With

End Sub
Sub Macro3()
If Range("B14") = "No" Then
Application.DisplayAlerts = False
Application.ScreenUpdating = False
Application.Goto Reference:="RR_Table_Copy"
Selection.Copy
Sheets("Rankin Report 2 - Detail").Select
Columns("C:D").Select
Selection.Insert Shift:=xlToRight
Range("C1:D76").Select
ActiveSheet.Paste Link:=True
Selection.PasteSpecial Paste:=xlPasteFormats, Operation:=xlNone, _
SkipBlanks:=False, Transpose:=False
Range("D1").Select
Application.CutCopyMode = False
Selection.ClearContents
Range("D5").Select
Selection.ClearContents
Range("D8").Select
Selection.ClearContents
Cells.Select
Cells.EntireColumn.AutoFit
Range("A1").Select
End If
End Sub
'​
 
Hi,
I am not using your code, not testing what it does...
Just sharing a way to combine:

Code:
Sub combine_3 ()
Call MacroRR1
Call Macro2
Call Macro3
End Sub

Regards,
 
Back
Top