PDA

View Full Version : Solved: Recycle UserForm



rrtts
10-25-2007, 12:16 PM
I'm customizing the "Help" form that I think was created by J. Walkenbach and free for public use. Thanks JW.

It's extremely easy to customize the form for a single worksheet. No problems there. What I'm trying to do is use one userform for multiple worksheets. I've attached a generic sample that should indicate what I'm trying to accomplish. Just in case though...

1. Three worksheets - CARS, TRUCKS, BOATS. Click the CARS button on Sheet1 and the userform displays the CAR information. Ideally, you could click the TRUCKS or BOATS button and the menu would reflect the information in those sheets. Currently TRUCKS and BOATS shows the CARS information because I'm not smart enough (yet) to figure this out.

The simple solution appears to be to use a seperate userform for each sheet but the more instances where I use this, the more objects/userforms I have to have in my workbook. So, I'm trying to figure out how to programmatically change the code. It seems like I should be able to REPLACE the individual parameters depending on which button is clicked, but use the same form.

This is where I'm running into problems. Should I just use multiple forms or is there some easy way to change the code based on which button is pressed. Any help would be greatly appreciated.

Bob Phillips
10-25-2007, 12:52 PM
Try this

rrtts
10-26-2007, 05:10 AM
Brilliant. You're a genius. I appreciate your assistance.

I was about to just use multiple forms but your solution works perfect. Thanks again and have a great weekend.