vba userform listbox

ccordner

Active Member
Joined
Apr 28, 2010
Messages
355
Is it possible to have a listbox in a userform, where the user selects the data by column instead of by row?

I want to set out a table, based on the days of the week, with days as column headings, so the user can select the day(s) of the week as appropriate.

Thanks
Chris
 

Excel Facts

Test for Multiple Conditions in IF?
Use AND(test, test, test, test) or OR(test, test, test, ...) as the logical_test argument of IF.
Well, I want a userform that is set out like this:

Sun Mon Tue Wed Thu Fri Sat
On 09:00 06:00 06:00 06:00 06:00 06:00 RD
Off
Worked
 
Upvote 0
Sorry, pressed 'Enter' too early.

Sun Mon Tue Wed Thu Fri Sat
On 09:00 06:00 06:00 06:00 06:00 06:00 R D
Off 16:00 13:00 13:00 31:00 13:00 13:00
Worked 08:00 07:00 07:00 07:00 07:00 07:00

I want a table set out in a userform, but so that the user can select one or more columns (days) to then process.

A listbox seems the easiest way to do it, but normally you select a row (on/off/worked), whereas I want them to be able to select a column, or two.

Hope this makes sense.

Thanks
Chris
 
Upvote 0
Thanks for that, but that seems to be about selecting a row and then working on the data for each column in that row.

That table didn't pad out properly, but what I want to do is put up times for each day of the week, then let the user select the columns for the days (e.g. Monday, Wednesday and Thursday) that they want to use.

If it helps, this is to deal with a job-share between two people. The user will need to select which days each person worked each week.

Thanks
Chris
 
Upvote 0
In Listbox properties, set:
1. ColumnCount = 7
2. ColumnHeads = True
3. RowSource = Data range EXCLUDING headers (VBA will figure out them) in format "=Sheet1!D15:K22"
 
Upvote 0
The problem with the Calendar Control is it only allows you to select a date. I need to pull information from the roster, which looks a bit like this:


u:\My Pictures\Roster.jpg


I need to capture the info in the red box and display it in a userform. Ideally, this would be in a listbox so that the user could select Mon, Tues and Wed for Alf and Fri/Sat for Sue.

If I use a Calendar Control, it depends on the user getting the dates right.

I'm not even sure if this is possible, but it would be a fairly foolproof way of doing it you see.
 
Upvote 0

Forum statistics

Threads
1,224,606
Messages
6,179,865
Members
452,948
Latest member
UsmanAli786

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