User Form Buttons

Matt5353

Board Regular
Joined
Nov 30, 2018
Messages
60
Office Version
  1. 2016
Platform
  1. Windows
I have a user form that has 12 Bottons on it 8, 10, 12, 14, 16 ,18, 20, 22, 24, 26, 28, 30.
These number represent how many players or teams that are going to play a game.
I want to add to each button a workbook that has all the imformation needed.
So when I press button 8 the workbook that is associated with 8 players comes up or if I press 30 that workbook opens etc.
Andrew
 

Excel Facts

Easy bullets in Excel
If you have a numeric keypad, press Alt+7 on numeric keypad to type a bullet in Excel.
Hi Andrew,

This will open a workbook called "My File.xlsx" in the "C:" directory (change to suit):

Code:
Option Explicit
Sub Macro1()

    Dim wb As Workbook
    
    Set wb = Workbooks.Open("C:\My File.xlsx")
    
End Sub

One question - why have different different workbooks for the number of players / teams? Can you not just have a single workbook with the maximum number of tabs (30) and just hide the number of tabs based on the button clicked? So if 14 was clicked the workbook would open and 16 of the tabs would be hidden (this is assuming that the number represents individual tabs of course).

HTH

Robert
 
Last edited:
Upvote 0
In each work book i have 6 sheets representing a sequence of games. There are 5 rounds of games to determine a winner at the end of the day. if i put it into one work book i wouls have approx 70-80 sheets.
 
Upvote 0
if i put it into one work book i would have approx 70-80 sheets.

Though I'm not a fan of workbooks with a large number of tabs, Excel could handle that no problem. Having one workbook would also make maintenance easier but it's up to you.

can you upload a sample file

You would have to host the file somewhere and provide a link to it as MrExcel doesn't have workbook attachment capability.

Regards,

Robert
 
Upvote 0
Can you give me your email and I will send it directly to you to view.
 
Upvote 0
Merry Xmas hope your day went well.
If you can supply me your email address I can certainly upload a file to you.
Hey and thanks for the help by the way.
Andrew (Matt5353)
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,173
Members
453,021
Latest member
Justyna P

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