two cell activated pop-up userforms?

hwkeyser

Board Regular
Joined
Jun 7, 2011
Messages
116
So, first-off i'm still very new to userforms. A few months ago i had help applying a userform which appeared the moment i clicked a particular cell, not a button, using the following vba:

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Not Intersect(Target, Range("G30,P30")) Is Nothing Then
Module4.OpenCalendar
End If
End Sub

I now have a new, separate userform i'd like to appear in the same manner, but i'm not sure how to apply it into the same worksheet. I've gotten nothing but errors in my multiple different tries, but here's the best i've got for now.


Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Not Intersect(Target, Range("G30,P30,Z30,AI30")) Is Nothing Then
If Intersect(Target, Range("G30,P30")) Then
Module4.OpenCalendar
End If
If Intersect(Target, Range("Z30,AI30")) Then
Module5.OpenTime
End If
End If
End Sub


Any help would be appreciated.


Also, is there anyway to single-click a userform listbox entry and apply the clicked value into the cell the userform opens from. I am able to do this with the calendar i have, i'm now trying to do the same thing with the time-picker i've created.

Thanks.

-HK
 

Excel Facts

Excel Joke
Why can't spreadsheets drive cars? They crash too often!
let's say your userform name is UserForm1.

Then you could Load it and show it by using this code:
Code:
Load Userform1
Userform1.Show

Load only 'opens' the userform as in it only allows the userform to be read to the memory but not show.
.Show obviously shows the userform :P
 
Upvote 0
The original userform already loads and shows via module4.OpenCalendar

I now have an additional userform loaded and showing through module5.OpenTime

My issue becomes i get debug errors anytime i try to run both at once because i'm not sure how to set up the changeselection intersections in order to have one module appear for two cells and another appear for two others and it not activate when any other cells are utilized
 
Upvote 0

Forum statistics

Threads
1,224,602
Messages
6,179,845
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