conditions for a userform to open

still learning

Well-known Member
Joined
Jan 15, 2010
Messages
821
Office Version
  1. 365
Platform
  1. Windows
Hi
I have a year of dates in A2:A400
I have events in some of the cells in B2:B400....(birthdays, anniversary's, etc)
If I use a formula to find today's date and put what is in B in cell F1
...maybe a vlookup of xlookup.....
that part I can do....
I can also make the year change to the current year around Jan 1, so that =today() will work
I'm wondering if I could have a userform open if:
it is today's date...and...
if F1 is not empty
I know how to make a userform and populate a list box with a row source
I dont know if i can have a userform open if a its today's date and the row source is NOT empty
I don't want a userform open with an empty list box, of a message saying "no event today"


mike
 

Excel Facts

Create a chart in one keystroke
Select the data and press Alt+F1 to insert a default chart. You can change the default chart to any chart type
Use a sheet event to run code to determine if the right parameters exist. Maybe BeforeDoubleClick or BeforeRightClick events.
That might be preferable over opening the form hidden and having it check the parameters and show if correct or close if not. Hiding a userform might clear entered values if it loads with any defauls (or so I read).
 
Upvote 0
Solution
Hi Micron
thanks.
I'll work on the macro this week. WHEN i have problems getting to work, I'll come back

Thanks again

mike
 
Upvote 0
hi mike,
Microns solution depends on sheet actions. My proposal is related to a date at workbook open. You need two things: a deadline date (e.g. Dec 15) and a boolean like isUpdated. If the current date is >= Dec 15 and isUpdated = false then do an action ...
 
Upvote 0
i got this to work. ( i'm surprised that I could)
VBA Code:
Sub test1()
    Dim rng As Range
    Dim r   As Range
    Dim bCellsFilled As Boolean
    Set rng = Sheet1.Range("f1")
    bCellsFilled = True
    For Each r In rng
        If r.Value = "" Then
            bCellsFilled = False
        End If
    Next r
    If bCellsFilled = True Then
        Call Macro1
    End If
End Sub
I'll put it in a "private sub activate"
I think I got a =filter statement to populate Fi....there a couple of times more names are associated with the same date
Excel Formula:
=FILTER(L2:M84,M2:M84=F1)
I ran out time to work on a userform.

Thank you both for the help. I'll get back next week with either questions or a pad on my back..As my name shows, I'm still learning. BUT I'm good at copy and paste from other examples !!!!!

mike
 
Upvote 0

Forum statistics

Threads
1,223,885
Messages
6,175,187
Members
452,616
Latest member
intern444

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