Custom Userform

Nine Zero

Well-known Member
Joined
Mar 10, 2016
Messages
625
Hello All!,

I am trying to input a userform msgbox because i would like the ability to format the text to my like in the msgbox. Now my question is, in my current msgbox code, which is pasted below, i have some formulas being input into the message. How would i be able to implement those into the userform.

I am fairly new with userforms, just discovered them recently and i think they are amazing!

Thank you for all your help!

Code:
    Sheets("RL").Select
    RLCounter = Application.WorksheetFunction.CountIfs(Range("P:P"), 1, Range("N:N"), "**Did Not Apply")
    Sheets("MA").Select
    MACounter = Application.WorksheetFunction.CountIf(Range("N:N"), 0)
    MsgBox "Maria, there are " & RLCounter & " unapplied transactions!" + vbNewLine + vbNewLine & "Also there are " & MACounter & " incorrectly applied!"
 

Excel Facts

Easy bullets in Excel
If you have a numeric keypad, press Alt+7 on numeric keypad to type a bullet in Excel.
If you are just looking for text similar to a messagebox, insert a label on your userform and then set the caption equal to the same thing you have for the message box.


Code:
UserForm1.Label1.Caption= "Maria, there are " & RLCounter & " unapplied transactions!" + vbNewLine + vbNewLine & "Also there are " & MACounter & " incorrectly applied!"


You will either have to make the label big enough to begin with, or you'll need to adjust the height and width properties progammatically.
 
Upvote 0
Thanks for the reply,

I just tried that out but the only thing showing up on my userform now is just the words "Label1" when it opens

EDIT:
Nevermind forgot to remove the previous msgbox i had before... now it works ....THANK YOU SO MUCH!
 
Last edited:
Upvote 0

Forum statistics

Threads
1,213,497
Messages
6,113,998
Members
448,539
Latest member
alex78

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