userform selections to appear in a separate popup window

westwind

New Member
Joined
Dec 9, 2005
Messages
48
Can someone please provide me with code that will take selections made in a userform via checkboxes, and display the results in a separate popup window.

I have 50 columns of cities on Sheet 1, each with 15 rows of data. I’d like call up a userform that contains checkboxes for each city. I created a userform and arranged the checkboxes in 4 separate vertical categories (columns), one for each Time Zone (ET, CT, MT and PT).

I’d like to be able to select any number of boxes (cities) in any of the 4 time zone categories and have the data for those cities (from Sheet 1) appear in a separate popup window so that I can close Excel and keep that window open (if possible). Also, I’d like the data to be displayed with some space between each time zone group.

Is this possible, and if so, what would the code be? If not, then what are the alternatives?

Thanks in advance for any help.
 

Excel Facts

What did Pito Salas invent?
Pito Salas, working for Lotus, popularized what would become to be pivot tables. It was released as Lotus Improv in 1989.
Hi westwind,

Everything that you describe is possible with the exception of "closing" Excel while keeping the popup, unless by "close Excel" you simply mean minimizing its process (which keeps its process running and minimized to the task bar).

However, I would like to suggest an alternative approach, since creating all those checkboxes (50 x 4?) could be a bit tedious. I would suggest you use four listboxes (one for each time zone) displaying the list of cities, with the listboxes all being multi-select capable and having checkboxes next to each item. To make a listbox multi-select, set its MultiSelect property to fmMultiSelectMulti, and have it display checkboxes set its ListStyle property to fmListStyleOption.

Regarding providing code, I don't think I understand your overall layout, the data, and how you would like the data presented to do that. I'm sure the solution is very straightforward, but also a bit tedious, and this may be a deterrent to getting a solution on this board. I would suggest you try to present a very simplified example showing your data and how you would like the results presented. For example, just 3 cities, two time zones, and just a few rows of data. Then you could extrapolate the solution received to the full problem.

I hope this helps.

Damon
 
Upvote 0
Thanks Damon!

You’re right, the multi-set listbox is a much better idea (btw, there are only 50 cities or columns, not 50 x 4).

Ok, I think the easiest way is to just use the 4 listbox (one for each time zone) and select the cities I’d like to hide and forget the popup window. There are various (non-adjacent) rows I’d like to hide as well.

I have the following simple code to hide columns & rows but I need help in modifying it to work for the above situation and listboxes. Again, any help is appreciated.

Code:
Private Sub ToggleButton1_Click()
    Application.ScreenUpdating = False
    If ToggleButton1.Value = True Then
        Application.Calculation = xlCalculationManual
        Columns("C:C").EntireColumn.Hidden = Not Columns("C:C").EntireColumn.Hidden
    Else
        Columns("C:C").EntireColumn.Hidden = Not Columns("C:C").EntireColumn.Hidden
    End If
    Application.ScreenUpdating = True
End Sub

Private Sub ToggleButton2_Click()
    Application.ScreenUpdating = False
    If ToggleButton2.Value = True Then
        Application.Calculation = xlCalculationManual
        For Each rCell In Range("A5:A8")
            rCell.EntireRow.Hidden = rCell = ""
        Next rCell
        Application.Calculation = xlCalculationManual
    Else
        Range("A5:A8").EntireRow.Hidden = False
    End If
    Application.ScreenUpdating = True
End Sub
 
Upvote 0

Forum statistics

Threads
1,214,788
Messages
6,121,575
Members
449,039
Latest member
Arbind kumar

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