gheyman
Well-known Member
- Joined
- Nov 14, 2005
- Messages
- 2,347
- Office Version
- 365
- Platform
- Windows
If I am on the tab "CMCS Tracker" this code runs perfectly. But if I try to run it while on another tab I get the run time error.
I wanted to launch the code from a button on another tab named "Search"
Any help is appreciated. Thanks!
I wanted to launch the code from a button on another tab named "Search"
Code:
Sub Macro1()
'
' Macro1 Macro
Sheets("CMCS Tracker").Range("A37").Range("A37").Select
Application.ScreenUpdating = False
'
Sheets("Results").ListObjects("Results").ListColumns("Sort").DataBodyRange.Copy
Sheets("CMCS Tracker").Range("A37").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
Sheets("Results").ListObjects("Results").ListColumns("Program").DataBodyRange.Copy
Sheets("CMCS Tracker").Range("B37").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
Sheets("Results").ListObjects("Results").ListColumns("PartNumber").DataBodyRange.Copy
Sheets("CMCS Tracker").Range("C37").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
Sheets("Results").ListObjects("Results").ListColumns("Description").DataBodyRange.Copy
Sheets("CMCS Tracker").Range("D37").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
Sheets("Results").ListObjects("Results").ListColumns("UM").DataBodyRange.Copy
Sheets("CMCS Tracker").Range("E37").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
Sheets("Results").ListObjects("Results").ListColumns("Rev Quoted").DataBodyRange.Copy
Sheets("CMCS Tracker").Range("F37").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
Sheets("Results").ListObjects("Results").ListColumns("CommCode").DataBodyRange.Copy
Sheets("CMCS Tracker").Range("G37").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
Sheets("Results").ListObjects("Results").ListColumns("Rev Needed").DataBodyRange.Copy
Sheets("CMCS Tracker").Range("H37").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
Sheets("Results").ListObjects("Results").ListColumns("DSRationale").DataBodyRange.Copy
Sheets("CMCS Tracker").Range("I37").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
Sheets("Results").ListObjects("Results").ListColumns("Revision").DataBodyRange.Copy
Sheets("CMCS Tracker").Range("J37").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
Sheets("Results").ListObjects("Results").ListColumns("Incumbent").DataBodyRange.Copy
Sheets("CMCS Tracker").Range("K37").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
Sheets("Results").ListObjects("Results").ListColumns("Last PO#").DataBodyRange.Copy
Sheets("CMCS Tracker").Range("L37").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
Sheets("Results").ListObjects("Results").ListColumns("Date of Last PO").DataBodyRange.Copy
Sheets("CMCS Tracker").Range("M37").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
Sheets("Results").ListObjects("Results").ListColumns("Source Type").DataBodyRange.Copy
Sheets("CMCS Tracker").Range("O37").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
Sheets("Results").ListObjects("Results").ListColumns("DRSQuoteID").DataBodyRange.Copy
Sheets("CMCS Tracker").Range("P37").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
Sheets("Results").ListObjects("Results").ListColumns("VendorName").DataBodyRange.Copy
Sheets("CMCS Tracker").Range("T37").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
Dim LLRow As Long
LLRow = Sheets("Results").Cells(Rows.Count, "C").End(xlUp).Row
Sheets("Results").Range("R2:AN" & LLRow).Copy
Sheets("CMCS Tracker").Range("U37").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
Sheets("Results").ListObjects("Results").ListColumns("Max NRE").DataBodyRange.Copy
Sheets("CMCS Tracker").Range("AR37").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
Sheets("Results").Range("AP2:AR" & LLRow).Copy
Sheets("CMCS Tracker").Range("AS37").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
Sheets("Results").Range("AT2:CG" & LLRow).Copy
Sheets("CMCS Tracker").Range("AV37").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
Application.ScreenUpdating = True
End Sub
Any help is appreciated. Thanks!