Print If ComboBox5.Value=Range("K8")

toughie

New Member
Joined
Oct 10, 2018
Messages
43
Im having issues with this code

This is what i would like the code to do - ComboBox5.Value = Range ("K8") if true print if false MsgBox "Incorrect Revision"




If ActiveSheet.Name = "VAM PINS" = True Then
If ComboBox5.Value = Range("'VAM PINS'!$K$8") = True Then
End If
ActiveSheet.PrintOut Copies:=TextBox3.Value




If ActiveSheet.Name = "VAM PINS" = True Then
If ComboBox5.Value = Range("'VAM PINS'!$K$8") = False Then
End If
MsgBox "Incorrect Revision"



If ActiveSheet.Name = "VAM BOX" = True Then
If ComboBox5.Value = Range("'VAM BOX'!$K$8") = True Then
End If
ActiveSheet.PrintOut Copies:=TextBox3.Value




If ActiveSheet.Name = "VAM BOX" = True Then
If ComboBox5.Value = Range("'VAM BOX'!$K$8") = False Then
End If
MsgBox "Incorrect Revision"


End If

End Sub

Any help is appreciated
 

Excel Facts

Shade all formula cells
To shade all formula cells: Home, Find & Select, Formulas to select all formulas. Then apply a light fill color.
Code:
   If ActiveSheet.Name = "VAM PINS" Or ActiveSheet.Name = "VAM BOX" Then
       If ComboBox5.Value = Range("$K$8") Then
            ActiveSheet.PrintOut Copies:=TextBox3.Value
       Else:
            MsgBox "Incorrect Revision"
       End If
   End If
 
Last edited:
Upvote 0
Hi AlphaFrog,

this help simplify my code but now only shows the message box even when my combobox5.value= K8

in cell K8 there is a vlookupformula does this affect the code?
 
Upvote 0
Hi AlphaFrog,

this help simplify my code but now only shows the message box even when my combobox5.value= K8

in cell K8 there is a vlookupformula does this affect the code?
 
Upvote 0
Are there numeric values in K8 and the combobox? If yes, try this...

Code:
    If ActiveSheet.Name = "VAM PINS" Or ActiveSheet.Name = "VAM BOX" Then
    
        If Val(ComboBox5.Value) = Range("$K$8") Then
    
            ActiveSheet.PrintOut Copies:=TextBox3.Value
    
        Else:
    
            MsgBox "Incorrect Revision"
    
        End If
    
    End If
 
Last edited:
Upvote 0
Solution
That has done the trick AlphaFrog!

Ive spent a couple weeks trying to complete the code and now it finally works

Huge thanks.
 
Upvote 0

Forum statistics

Threads
1,214,830
Messages
6,121,839
Members
449,051
Latest member
excelquestion515

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