Go to a tab before the code is executed

gheyman

Well-known Member
Joined
Nov 14, 2005
Messages
2,347
Office Version
  1. 365
Platform
  1. Windows
I have the code below that works well. But I am trying to get the code to go to the tab named "PLEASE WAIT" first.
But when I run the code, it stays on the tab thats active and doesnt select/activate the "PLEASE WAIT"

Code:
Sub LoadProPricerTemplates()
'
Sheets("PLEASE WAIT").Visible = True
Sheets("PLEASE WAIT").Select
Range("A1").Select

Application.ScreenUpdating = False

'*ProPricer Template: Material Assco Cost - Sheet19
'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
            UserFormX.Show vbModeless
               UserFormX.LabelProg.Width = 30
               UserFormX.LabelProg.Caption = "19%"
               DoEvents
'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Sheets("Material Assoc Costs").Visible = True
Sheets("PP_Material_Assoc_Costs").Visible = True

Sheets("PP_Material_Assoc_Costs").ListObjects(1).QueryTable.Refresh BackgroundQuery:=False


'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
                    UserFormX.LabelProg.Width = 35
                    UserFormX.LabelProg.Caption = "23%"
                    DoEvents
'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

'*First Clear PP template Material Assoc Costs
    Dim Lr19 As Long

    Sheets("Material Assoc Costs").Select
    Lr19 = Sheets("Material Assoc Costs").Cells(Rows.Count, "A").End(xlUp).Row
    If Lr19 > 2 Then Sheet19.Range("A3:Y" & Lr19).ClearContents

'* Copy data to Template
    Sheets("PP_Material_Assoc_Costs").Select
    Range("PP_Material_Assoc_Costs[TASK ID]").Select
        Selection.Copy
    Sheets("Material Assoc Costs").Select
        Range("A3").Select
            Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
                :=False, Transpose:=False
    
    Sheets("PP_Material_Assoc_Costs").Select
    Range("PP_Material_Assoc_Costs[Material ID]").Select
        Selection.Copy
    Sheets("Material Assoc Costs").Select
        Range("B3").Select
        Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
            :=False, Transpose:=False
    
    Sheets("PP_Material_Assoc_Costs").Select
    Range("PP_Material_Assoc_Costs[Ref ID]").Select
        Selection.Copy
    Sheets("Material Assoc Costs").Select
        Range("C3").Select
            Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
                :=False, Transpose:=False
    
    Sheets("PP_Material_Assoc_Costs").Select
    Range("PP_Material_Assoc_Costs[Resource]").Select
        Selection.Copy
    Sheets("Material Assoc Costs").Select
        Range("D3").Select
            Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
                :=False, Transpose:=False

    Sheets("PP_Material_Assoc_Costs").Select
    Range("PP_Material_Assoc_Costs[Amount]").Select
        Selection.Copy
    Sheets("Material Assoc Costs").Select
        Range("L3").Select
            Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
                :=False, Transpose:=False
        Range("X3").Select
            Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
                :=False, Transpose:=False


    Sheets("PP_Material_Assoc_Costs").Select
    Range("PP_Material_Assoc_Costs[Link Qty]").Select
        Selection.Copy
    Sheets("Material Assoc Costs").Select
        Range("M3").Select
            Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
                :=False, Transpose:=False
    
    Sheets("PP_Material_Assoc_Costs").Select
    Range("PP_Material_Assoc_Costs[Link Spead]").Select
        Selection.Copy
    Sheets("Material Assoc Costs").Select
        Range("N3").Select
            Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
                :=False, Transpose:=False
    
    
    Sheets("PP_Material_Assoc_Costs").Select
    Range("PP_Material_Assoc_Costs[Curve]").Select
        Selection.Copy
    Sheets("Material Assoc Costs").Select
        Range("T3").Select
            Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
            :=False, Transpose:=False
    
    Sheets("PP_Material_Assoc_Costs").Select
    Range("PP_Material_Assoc_Costs[Spread Method]").Select
        Selection.Copy
    Sheets("Material Assoc Costs").Select
        Range("U3").Select
            Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
            :=False, Transpose:=False
    
    Sheets("PP_Material_Assoc_Costs").Select
    Range("PP_Material_Assoc_Costs[StartDate]").Select
        Selection.Copy
    Sheets("Material Assoc Costs").Select
        Range("V3").Select
            Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
            :=False, Transpose:=False
        
    Sheets("PP_Material_Assoc_Costs").Select
    Range("PP_Material_Assoc_Costs[EndDate]").Select
        Selection.Copy
    Sheets("Material Assoc Costs").Select
        Range("W3").Select
        Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
            :=False, Transpose:=False
        
      Application.CutCopyMode = False
      
Sheets("PP_Material_Assoc_Costs").Visible = xlSheetVeryHidden
      
'*ProPricer Template: Vendors - Sheet18
'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
               UserFormX.LabelProg.Width = 75
               UserFormX.LabelProg.Caption = "34%"
               DoEvents
'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

'*Refresh
Sheets("Vendors").Visible = True
Sheets("PP_Vendors").Visible = True

Sheets("PP_Vendors").ListObjects(1).QueryTable.Refresh BackgroundQuery:=False

'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
                    UserFormX.LabelProg.Width = 80
                    UserFormX.LabelProg.Caption = "38%"
                    DoEvents
'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

'*First Clear PP template Material Assoc Costs
Dim Lr18 As Long

    Sheets("Vendors").Select
    Lr18 = Sheets("Vendors").Cells(Rows.Count, "A").End(xlUp).Row
    If Lr18 > 2 Then Sheet18.Range("A3:V" & Lr18).ClearContents

'* Copy data to Template
    Sheets("PP_Vendors").Select
    Range("PP_Vendors[Name]").Select
        Selection.Copy
    Sheets("Vendors").Select
        Range("A3").Select
            Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
                :=False, Transpose:=False
        
    Sheets("PP_Vendors").Select
    Range("PP_Vendors[Address1]").Select
        Selection.Copy
    Sheets("Vendors").Select
        Range("B3").Select
            Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
                :=False, Transpose:=False
      
    Sheets("PP_Vendors").Select
    Range("PP_Vendors[Address2]").Select
        Selection.Copy
    Sheets("Vendors").Select
        Range("C3").Select
            Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
                :=False, Transpose:=False
        
    Sheets("PP_Vendors").Select
    Range("PP_Vendors[City]").Select
        Selection.Copy
    Sheets("Vendors").Select
        Range("D3").Select
            Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
                :=False, Transpose:=False

    Sheets("PP_Vendors").Select
    Range("PP_Vendors[State]").Select
        Selection.Copy
    Sheets("Vendors").Select
        Range("E3").Select
            Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
                :=False, Transpose:=False

    Sheets("PP_Vendors").Select
    Range("PP_Vendors[Country Name]").Select
        Selection.Copy
    Sheets("Vendors").Select
    'Country Code
        Range("F3").Select
            Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
                :=False, Transpose:=False
        
    Sheets("PP_Vendors").Select
    Range("PP_Vendors[Small Business Code]").Select
        Selection.Copy
    Sheets("Vendors").Select
    'Small Business
        Range("G3").Select
            Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
                :=False, Transpose:=False
        
    Sheets("PP_Vendors").Select
    Range("PP_Vendors[Vednor Status]").Select
        Selection.Copy
    Sheets("Vendors").Select
    'Status
        Range("H3").Select
            Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
            :=False, Transpose:=False

    Sheets("PP_Vendors").Select
    Range("PP_Vendors[Comments]").Select
        Selection.Copy
    Sheets("Vendors").Select
    'Comments
        Range("I3").Select
            Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
            :=False, Transpose:=False
        
    Sheets("PP_Vendors").Select
    Range("PP_Vendors[Created by]").Select
        Selection.Copy
    Sheets("Vendors").Select
    '[MF] Created by
        Range("S3").Select
            Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
            :=False, Transpose:=False
        
    Sheets("PP_Vendors").Select
    Range("PP_Vendors[Created]").Select
        Selection.Copy
    Sheets("Vendors").Select
    '[MF] Created
        Range("T3").Select
            Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
                :=False, Transpose:=False
    
    
    Sheets("PP_Vendors").Select
    Range("PP_Vendors[Corp_CountryList.Sensitive Country]").Select
        Selection.Copy
    Sheets("Vendors").Select
    '[MF] Sensitve Country
        Range("V3").Select
            Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
                :=False, Transpose:=False
        
         Application.CutCopyMode = False
         
Sheets("PP_Vendors").Visible = xlSheetVeryHidden
        
  '*ProPricer Template: Cost Sources - Sheet16
'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
               UserFormX.LabelProg.Width = 100
               UserFormX.LabelProg.Caption = "51%"
               DoEvents
'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

'*Refresh
Sheets("Cost Sources").Visible = True
Sheets("PP_Cost_Sources").Visible = True

Sheets("PP_Cost_Sources").ListObjects(1).QueryTable.Refresh BackgroundQuery:=False

'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
                    UserFormX.LabelProg.Width = 110
                    UserFormX.LabelProg.Caption = "56%"
                    DoEvents
'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

'*First Clear PP template Material Assoc Costs
Dim Lr16 As Long

    Sheets("Cost Sources").Select
    Lr16 = Sheets("Cost Sources").Cells(Rows.Count, "A").End(xlUp).Row
    If Lr16 > 2 Then Sheet16.Range("A3:AD" & Lr16).ClearContents
        
'* Copy data to Template

    Sheets("PP_Cost_Sources").Select
    Range("PP_Cost_Sources[Name]").Select
        Selection.Copy
    Sheets("Cost Sources").Select
    'Material
        Range("A3").Select
            Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
                :=False, Transpose:=False
                
    Sheets("PP_Cost_Sources").Select
    Range("PP_Cost_Sources[Material Type]").Select
        Selection.Copy
    Sheets("Cost Sources").Select
    'Material Type
        Range("B3").Select
            Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
                :=False, Transpose:=False
                
    Sheets("PP_Cost_Sources").Select
    Range("PP_Cost_Sources[Category]").Select
        Selection.Copy
    Sheets("Cost Sources").Select
    'Type
        Range("C3").Select
            Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
                :=False, Transpose:=False
                            
    Sheets("PP_Cost_Sources").Select
    Range("PP_Cost_Sources[MaterialCostSourceName]").Select
        Selection.Copy
    Sheets("Cost Sources").Select
    'ID
        Range("D3").Select
            Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
                :=False, Transpose:=False
                
    Sheets("PP_Cost_Sources").Select
    Range("PP_Cost_Sources[Revision]").Select
        Selection.Copy
    Sheets("Cost Sources").Select
    'Revision
        Range("E3").Select
            Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
                :=False, Transpose:=False
                
    Sheets("PP_Cost_Sources").Select
    Range("PP_Cost_Sources[StartDate]").Select
        Selection.Copy
    Sheets("Cost Sources").Select
    'From Date
        Range("F3").Select
            Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
                :=False, Transpose:=False
                
    Sheets("PP_Cost_Sources").Select
    Range("PP_Cost_Sources[EndDate]").Select
        Selection.Copy
    Sheets("Cost Sources").Select
    'To Date
        Range("G3").Select
            Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
                :=False, Transpose:=False
                
    Sheets("PP_Cost_Sources").Select
    Range("PP_Cost_Sources[VendorName]").Select
        Selection.Copy
    Sheets("Cost Sources").Select
    'Vendor
        Range("I3").Select
            Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
                :=False, Transpose:=False
                
    Sheets("PP_Cost_Sources").Select
    Range("PP_Cost_Sources[LeadTime]").Select
        Selection.Copy
    Sheets("Cost Sources").Select
    'Lead Time
        Range("J3").Select
            Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
                :=False, Transpose:=False
                
    Sheets("PP_Cost_Sources").Select
    Range("PP_Cost_Sources[MinBuyQty]").Select
        Selection.Copy
    Sheets("Cost Sources").Select
    'Min Buy Quantity
        Range("K3").Select
            Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
                :=False, Transpose:=False
                
    Sheets("PP_Cost_Sources").Select
    Range("PP_Cost_Sources[MaterialCostSourceComments]").Select
        Selection.Copy
    Sheets("Cost Sources").Select
    'Comments
        Range("L3").Select
            Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
                :=False, Transpose:=False
                
    Sheets("PP_Cost_Sources").Select
    Range("PP_Cost_Sources[EscalationBaseDate]").Select
        Selection.Copy
    Sheets("Cost Sources").Select
    'Escalation Base Date
        Range("M3").Select
            Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
                :=False, Transpose:=False
                
    Sheets("PP_Cost_Sources").Select
    Range("PP_Cost_Sources[Escalation ID]").Select
        Selection.Copy
    Sheets("Cost Sources").Select
    'Escalation ID
        Range("N3").Select
            Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
                :=False, Transpose:=False
 
    Sheets("PP_Cost_Sources").Select
    Range("PP_Cost_Sources[EnableDeEscalation]").Select
        Selection.Copy
    Sheets("Cost Sources").Select
    'Enable DeEscalation
        Range("O3").Select
            Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
                :=False, Transpose:=False
 
    Sheets("PP_Cost_Sources").Select
    Range("PP_Cost_Sources[2]").Select
        Selection.Copy
    Sheets("Cost Sources").Select
    '[MF] Subcategory
        Range("P3").Select
            Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
                :=False, Transpose:=False
 
    Sheets("PP_Cost_Sources").Select
    Range("PP_Cost_Sources[5]").Select
        Selection.Copy
    Sheets("Cost Sources").Select
    '[MF] POCrvdFromQty
        Range("T3").Select
            Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
                :=False, Transpose:=False
 
    Sheets("PP_Cost_Sources").Select
    Range("PP_Cost_Sources[6]").Select
        Selection.Copy
    Sheets("Cost Sources").Select
    '[MF] POCrvdFromUnitPrice
        Range("U3").Select
            Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
                :=False, Transpose:=False
 
    Sheets("PP_Cost_Sources").Select
    Range("PP_Cost_Sources[7]").Select
        Selection.Copy
    Sheets("Cost Sources").Select
    '[MF] POAppliedCurve
        Range("V3").Select
            Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
                :=False, Transpose:=False
 
    Sheets("PP_Cost_Sources").Select
    Range("PP_Cost_Sources[17]").Select
        Selection.Copy
    Sheets("Cost Sources").Select
    '[MF] Created by
        Range("W3").Select
            Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
                :=False, Transpose:=False
 
    Sheets("PP_Cost_Sources").Select
    Range("PP_Cost_Sources[18]").Select
        Selection.Copy
    Sheets("Cost Sources").Select
    '[MF] Created
        Range("X3").Select
            Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
                :=False, Transpose:=False
 
    Sheets("PP_Cost_Sources").Select
    Range("PP_Cost_Sources[19]").Select
        Selection.Copy
    Sheets("Cost Sources").Select
    '[MF] VendorID
        Range("Y3").Select
            Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
                :=False, Transpose:=False
 
    Sheets("PP_Cost_Sources").Select
    Range("PP_Cost_Sources[20]").Select
        Selection.Copy
    Sheets("Cost Sources").Select
    '[MF] Excess Mtrl?
        Range("Z3").Select
            Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
                :=False, Transpose:=False
 
    Sheets("PP_Cost_Sources").Select
    Range("PP_Cost_Sources[21]").Select
        Selection.Copy
    Sheets("Cost Sources").Select
    '[MF] Tariffs?
        Range("AA3").Select
            Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
                :=False, Transpose:=False
 
    Sheets("PP_Cost_Sources").Select
    Range("PP_Cost_Sources[22]").Select
        Selection.Copy
    Sheets("Cost Sources").Select
    '[MF] NRE?
        Range("AB3").Select
            Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
                :=False, Transpose:=False
 
    Sheets("PP_Cost_Sources").Select
    Range("PP_Cost_Sources[23]").Select
        Selection.Copy
    Sheets("Cost Sources").Select
    '[MF] Path/Location
        Range("AC3").Select
            Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
                :=False, Transpose:=False
 
    Sheets("PP_Cost_Sources").Select
    Range("PP_Cost_Sources[24]").Select
        Selection.Copy
    Sheets("Cost Sources").Select
    '[MF] Vendor Quote ID
        Range("AD3").Select
            Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
                :=False, Transpose:=False
 
'*Get Product Library

    Lr16 = Sheets("Cost Sources").Cells(Rows.Count, "A").End(xlUp).Row
    
    Sheets("Selected Prod Library").Select
    Range("A2").Select
        Selection.Copy
    Sheets("Cost Sources").Select
        Range("H3:H" & Lr16).Select
            Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
                :=False, Transpose:=False
                
    Application.CutCopyMode = False

Sheets("PP_Cost_Sources").Visible = xlSheetVeryHidden
    
  '*ProPricer Template: Cost Source Details - Sheet17
'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
               UserFormX.LabelProg.Width = 150
               UserFormX.LabelProg.Caption = "75%"
               DoEvents
'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

'*Refresh

Sheets("Cost Source Details").Visible = True
Sheets("PP_Cost_Source_Details").Visible = True

Sheets("PP_Cost_Source_Details").ListObjects(1).QueryTable.Refresh BackgroundQuery:=False

'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
                    UserFormX.LabelProg.Width = 158
                    UserFormX.LabelProg.Caption = "79%"
                    DoEvents
'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

'*First Clear PP template Material Assoc Costs
Dim Lr17 As Long

    Sheets("Cost Source Details").Select
    Lr17 = Sheets("Cost Source Details").Cells(Rows.Count, "A").End(xlUp).Row
    If Lr17 > 2 Then Sheet17.Range("A3:I" & Lr17).ClearContents
        
'* Copy data to Template

    Sheets("PP_Cost_Source_Details").Select
    Range("PP_Cost_Source_Details[Name]").Select
        Selection.Copy
    Sheets("Cost Source Details").Select
    'Material
        Range("A3").Select
            Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
                :=False, Transpose:=False
    
    Sheets("PP_Cost_Source_Details").Select
    Range("PP_Cost_Source_Details[Material Type]").Select
        Selection.Copy
    Sheets("Cost Source Details").Select
    'Material Type
        Range("B3").Select
            Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
                :=False, Transpose:=False
                
    Sheets("PP_Cost_Source_Details").Select
    Range("PP_Cost_Source_Details[Category]").Select
        Selection.Copy
    Sheets("Cost Source Details").Select
    'Type
        Range("C3").Select
            Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
                :=False, Transpose:=False
                            
    Sheets("PP_Cost_Source_Details").Select
    Range("PP_Cost_Source_Details[MaterialCostSourceName]").Select
        Selection.Copy
    Sheets("Cost Source Details").Select
    'ID
        Range("D3").Select
            Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
                :=False, Transpose:=False
                
    Sheets("PP_Cost_Source_Details").Select
    Range("PP_Cost_Source_Details[Revision]").Select
        Selection.Copy
    Sheets("Cost Source Details").Select
    'Revision
        Range("E3").Select
            Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
                :=False, Transpose:=False
    
    Sheets("PP_Cost_Source_Details").Select
    Range("PP_Cost_Source_Details[FromQty]").Select
        Selection.Copy
    Sheets("Cost Source Details").Select
    'From Quantity
        Range("F3").Select
            Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
                :=False, Transpose:=False
    
    Sheets("PP_Cost_Source_Details").Select
    Range("PP_Cost_Source_Details[ToQty]").Select
        Selection.Copy
    Sheets("Cost Source Details").Select
    'To Quantity
        Range("G3").Select
            Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
                :=False, Transpose:=False
    
    Sheets("PP_Cost_Source_Details").Select
    Range("PP_Cost_Source_Details[UnitCost]").Select
        Selection.Copy
    Sheets("Cost Source Details").Select
    'Unit Cost
        Range("H3").Select
            Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
                :=False, Transpose:=False
    
    Sheets("PP_Cost_Source_Details").Select
    Range("PP_Cost_Source_Details[MaterialCostSourceDetailComments]").Select
        Selection.Copy
    Sheets("Cost Source Details").Select
    'Comments
        Range("I3").Select
            Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
                :=False, Transpose:=False
                
    Application.CutCopyMode = False
    
  Sheets("PP_Cost_Source_Details").Visible = xlSheetVeryHidden

 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
               UserFormX.LabelProg.Width = 198
               UserFormX.LabelProg.Caption = "98%"
               DoEvents
               UserFormX.Hide
'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Sheets("PLEASE WAIT").Visible = xlSheetVeryHidden
Sheets("Task PBoMs").Select
Application.ScreenUpdating = True

MsgBox "Review the ProPricer Templates for accuracy. Then use the ProPricer Ribbon function to export the data to the ProPricer Database. Be sure to load the tempates to the correct libraries"
        
End Sub
 

Excel Facts

Quick Sum
Select a range of cells. The total appears in bottom right of Excel screen. Right-click total to add Max, Min, Count, Average.
Try adding DoEvents after selecting the sheet:
VBA Code:
Sheets("PLEASE WAIT").Select
Range("A1").Select
DoEvents : DoEvents                                     '<<< ADD THIS LINE
Application.ScreenUpdating = False
 
Upvote 0

Forum statistics

Threads
1,223,903
Messages
6,175,279
Members
452,630
Latest member
OdubiYouth

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