VBA code for Excel

Status
This thread has been Locked and is not open to further replies. Please start a New Thread if you're having a similar issue. View our Welcome Guide to learn how to use this site.

Keebellah

Hans
Thread Starter
Trusted Advisor
Joined
Mar 27, 2008
Messages
6,639
Hi, I'm new to this forum.
I was looking for different dialog options and VBA code for my Excel sheets when I came upon the Printer.Dlg code where you can choose the sheet you want to print.
I have altered the code in such a manner that you can use the checkboxes to select one or more items from a specific range in any sheet and whereever it is located.
If there is anyone intersetd I will post it.
What is does is you call the function giving the sheetname, column letter, starting rownumber and endding rownumber:
Call SelectFromList("Sheet3", "D" , 5, 25)
This will result in a Dialog screen with a list of 20 values in the range which you can select and then write that part of the code you need that does something with this.
The code allows any number of rows, The max per dialog screen is 200 spread over 4 columns of 50.
It was fun to do.
I am beginning to like VBA routines in my Excel sheets thus permitting users to enter only that data which is requested of making only the permitted selections.

Thanks for the attention.

Cheers,

Hans
 
Joined
Oct 20, 2004
Messages
7,837
Hi, since you started this, please do post your code so if someone else comes looking for such a solution they can find it.
I would suggest that you check out this site also - it's a great place for coders and several of the other who post here regularly also haunt it (in fact, one of the people who manages it, who goes by firefytr, is also a regular here)
http://www.vbaexpress.com/forum/index.php
 

Keebellah

Hans
Thread Starter
Trusted Advisor
Joined
Mar 27, 2008
Messages
6,639
You're right,
I have attached the code, it's in the attachment XSelectFromListModule.zip.

Just import it as a module in any excel sheet and call the function SelectFromList with parameters.
There are 4 optional parameters:
tSheet = the name of the sheet containing the list of names / files, whatever
tRange = the column e.g A, B, C, ..... Y, Z, AA
tRow = the row where the list starts, default is 2
tEndRow= the last row in the list, if left blank the range will search for the last row filled

In my test here I am stille busy with an additional parameter where you can call the procedure or function you wish to exceute with the made choice.

Like I said this code is based upon code I found via Google and adapted to my needs. Try it and all comments and corrections are welcome.

Cheers,
Hans
 

Attachments

Status
This thread has been Locked and is not open to further replies. Please start a New Thread if you're having a similar issue. View our Welcome Guide to learn how to use this site.

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 807,865 other people just like you!

Latest posts

Staff online

Top