Userform input box to stop looping

jadif01

New Member
Joined
Jul 18, 2013
Messages
5
I've been designing a userForm where the user can input a certain string into an Inputbox which will set off a load of Macros. The problem is that the Inputbox comes up multiple times depending on which code the user inputs.

For example, if the user inputs 100H2102 it does it first time. If he types in 250H2204 they have to type it twice.
Is there a way for it to just come up once, instead of looping constantly?


Any help with this problem would be much appreciated. I've included a section of the code below for extra explanation:



Sub CommandButton1_Click()
If InputBox("Input Corrugation (Cell B3)") = "100H2102" Then
If InputBox("Input Wavepitch (Cell E9)") = "0.625" Then
Range("H6").Value = "1042"
AppendToExisitingOnRight
AppendToExistingOnLeft
Macro1
Macro2_1
Macro3
Macro4
Macro5
Macro6
Macro7
Macro8
Macro9

End If
Else
If InputBox("Input Corrugation (Cell B3)") = "250H2204" Then
Range("H6").Value = "1232"
AppendToExisitingOnRight
AppendToExistingOnLeft
Macro1
Macro2_2
Macro3
Macro4
Macro5
Macro6
Macro7
Macro8
Macro9
End If
End If
End Sub
 

Excel Facts

When they said...
When they said you are going to "Excel at life", they meant you "will be doing Excel your whole life".
Why not use textboxes on the userform for the userinput?
 
Upvote 0

Forum statistics

Threads
1,216,788
Messages
6,132,703
Members
449,753
Latest member
swastikExcel

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