How to get button to only send if values are correct?

Lis20

New Member
Joined
Nov 10, 2016
Messages
6
I have a list of weightings that must add up to 10. I have a submit button that then copies the weightings on to another sheet for calculations. How do I make sure that people using the sheet can only press submit unless the weightings total 10? Is there an easy way to code this??


1W8nwEu.png
 

Excel Facts

Copy a format multiple times
Select a formatted range. Double-click the Format Painter (left side of Home tab). You can paste formatting multiple times. Esc to stop
Allow them to hit the submit button but put a test in the copy code (say your total is in B10) i.e

Code:
    If Range("B10") = 10 Then
        'YOUR COPY CODE
    Else
        Exit Sub
    End If
 
Upvote 0
Thank you so much.

Is there a way to get an error pop up saying that the weightings don't add to the correct value?
 
Upvote 0
Code:
    If Range("B10") = 10 Then
        'YOUR COPY CODE
    Else
MsgBox "weightings don't add to the correct value"
        Exit Sub
    End If
 
Upvote 0

Forum statistics

Threads
1,213,560
Messages
6,114,304
Members
448,564
Latest member
ED38

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