Tabbed Browsing -> switching between tabs

mattmexcel

Board Regular
Joined
Dec 5, 2007
Messages
59
Happy Friday,

I'm working on a user form with tabbed browsing and can't quite figure this one out.

I have a tab with two text boxes on it that get user inputs. If a user clicks a different tab, and the value in first text box is higher than the other, i want a message box to pop up saying that the other value must be greater than or equal to the first value. I get this to happen using the following code:

Code:
 Private Sub MultiPage1_Change()
    
    'Return error if capitalized interest is greater than interest only
    If txtCapI.Value > txtInterestOnly.Value Then
        MsgBox "Interest only must be equal to or greater than Capitalized Interest. Please  update assumptions.", vbOKOnly, "Error"

     End If

However, after the user hits "OK" it takes them to whichever tab they have clicked on. I want the focus to stay on the current tab so that they can make the changes. Any thoughts?

Thanks,

Matt
 

Excel Facts

Will the fill handle fill 1, 2, 3?
Yes! Type 1 in a cell. Hold down Ctrl while you drag the fill handle.
Any ideas on how to get this to work? Did I not explain it well enough?

I'm a newbie when it comes to vba, so maybe I am just going about this the wrong way. Any help would be greatly appreciated.
 
Upvote 0

Forum statistics

Threads
1,215,063
Messages
6,122,928
Members
449,094
Latest member
teemeren

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