![]() |
VBA Code to Create a Toggle Button
I am trying to create code that will look in a given path and add a toggle
button (or command button) to an existing user form for each file in the folder that the path referenced. I would like the toggle button that is added to be linked to code that will open the file that the button references. For example if "MyFolder" contains: Abc.xls Def.Doc Ghi.txt I would like the code to create a button on "MyUserform" for each of the 3 files, that will open the file when the userform is activated and the particular button is clicked. I envision the code that populates the userform being in the "ThisWorkbook" module and running when the workbook is opened. Thanks for any help you can give me |
VBA Code to Create a Toggle Button
Look he
http://j-walk.com/ss/excel/tips/userformtips.htm -- Regards, Tom Ogilvy "Brandt" wrote in message ... I am trying to create code that will look in a given path and add a toggle button (or command button) to an existing user form for each file in the folder that the path referenced. I would like the toggle button that is added to be linked to code that will open the file that the button references. For example if "MyFolder" contains: Abc.xls Def.Doc Ghi.txt I would like the code to create a button on "MyUserform" for each of the 3 files, that will open the file when the userform is activated and the particular button is clicked. I envision the code that populates the userform being in the "ThisWorkbook" module and running when the workbook is opened. Thanks for any help you can give me |
VBA Code to Create a Toggle Button
Thanks Tom, it looks like this is just what I need!
"Tom Ogilvy" wrote: Look he http://j-walk.com/ss/excel/tips/userformtips.htm -- Regards, Tom Ogilvy "Brandt" wrote in message ... I am trying to create code that will look in a given path and add a toggle button (or command button) to an existing user form for each file in the folder that the path referenced. I would like the toggle button that is added to be linked to code that will open the file that the button references. For example if "MyFolder" contains: Abc.xls Def.Doc Ghi.txt I would like the code to create a button on "MyUserform" for each of the 3 files, that will open the file when the userform is activated and the particular button is clicked. I envision the code that populates the userform being in the "ThisWorkbook" module and running when the workbook is opened. Thanks for any help you can give me |
All times are GMT +1. The time now is 01:23 PM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com