Spot why this doesnt work properly!

Submersed

Board Regular
Joined
Jul 6, 2007
Messages
167
Office Version
  1. 365
Platform
  1. Windows
Hi all,

When this code is in a button created by the "Forms" toolbar it works correctly...but i need it in a Combobox created by the "Control Toolbox" toolbar at it doesnt do some of the code...Can anyone figure out why??

Code:
Private Sub ComboBox1_Change()
' Mascot Addition - Start
    Application.ScreenUpdating = False
' Mascot Addition - End




    
    Sheets("Master").Select
    Dim a
    Dim B
    Dim C
    Dim D
    Dim E
    Dim F
    Dim G
    Dim iCurrType As Integer    'Declared the variable to get the Currency Type
    Dim strSheetName As String
    
' Go to chosen price list
'   Value in cell (10, 3) generated from drop down box
    
    E = ComboBox1.ListIndex + 1
'   Version 44 change start
    If E = "" Or E <= 0 Or E > 59 Then Exit Sub   ' model details not available
'   If E = "" Or E <= 0 Or E > 54 Then Exit Sub   ' model details not available
    strSheetName = Trim(Str(E))
    Sheets(strSheetName).Select
'   Vesion 44 change end

    
' Mascot Change End
' Copy all information from separate price list to Master sheet
' Mascot Change - Start
'   For A = 13 To 315
'   For a = 13 To 325
    For a = 13 To 353
' Mascot Change - End
'       B = Cells(a, 2)
        C = Cells(a, 3)
        D = Cells(a, 4)
        G = Cells(a, 1)
    
'   Copy Feature Description with attributes like Bold etc.
        Sheets(strSheetName).Cells(a, 2).Copy
        Sheets("Master").Cells(a, 2).PasteSpecial
    
'       Sheets("Master").Cells(a, 2) = B
        Sheets("Master").Cells(a, 3) = C
        Sheets("Master").Cells(a, 6) = D
        Sheets("Master").Cells(a, 1) = G

'  Kris Check Standard items
        'If a >= 51 Then
            'If Sheets("Master").Cells(a, 6).Value = "STD" Then
               ' Sheets("Master").Cells(a, 5) = "True"
           ' End If
           ' If Sheets("Master").Cells(a, 6).Value <> "STD" Then
               ' Sheets("Master").Cells(a, 5) = "False"
           ' End If
       ' End If
    Next a
    
    Application.CutCopyMode = False
    
    Sheets("Master").Select
' Mascot Change - Start
'   For F = 41 To 315
'   For F = 51 To 325
' Mascot Change - End
'       Sheets("Master").Cells(F, 5) = "FALSE"
'   Next F
' Clear Model Number from Master sheet
' Mascot Change - Start
'   Sheets("Master").Cells(6, 6).Select
'   Selection.ClearContents
    Sheets("Master").Cells(6, 13) = 1      ' set default model to 1st. model in family
' Mascot Change - End
'
' Mascot Addition - Start

'   Kris change - Clear Check Boxes

    Range("E52:E354").Value = False

    Range("a1").Select
    Application.ScreenUpdating = True
' Mascot Addition - End
End Sub

Many Thanks
 

Excel Facts

Difference between two dates
Secret function! Use =DATEDIF(A2,B2,"Y")&" years"&=DATEDIF(A2,B2,"YM")&" months"&=DATEDIF(A2,B2,"MD")&" days"

Forum statistics

Threads
1,181,734
Messages
5,931,731
Members
436,800
Latest member
abowalid98

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
Top