Introduction

Introducing Form for Excel (64bit)

Form, UserForm Notification Msgbox Class with RGB for Excel 64bit only · use Form to create UserForm Notification MsgBoxes with MouseOver Buttons

Here is a compact, single Class for Excel that allows you to create one or many UserForm Message Notification Boxes from a Base UserForm with a Message and two Buttons (3 Labels). The Class gives you many features used by my UserFormExtensibility Software like adding a DropShadow for a borderless UserForm, changing the Cursor on the UserForm or any of its Controls, removing the Caption and Borders from UserForms, allowing any the UserForm or any of its Controls to be draggable and giving Buttons created with Labels a Mouseover fade in effect. Its usefulness is in creating one shared instance (UserForm and Class) or creating many instances, all of which can be controlled, moved and/or exited at any time. It is fast, flexible and expandable




If you love Form, you may also like any of the following Software


UserFormExtensibility

Prerequisites

  • Microsoft Excel 2016, 64bit only, Version 16 · designed for Office 365 Windows 11
  • Basic to moderate Excel Skills and some moderate VBA skills
  • Windows PC · NOT a Mac!
  • No support is provided for customization of this Software

Features

  • Single Class that can create one instance or multiple instances of any base UserForms
  • Wrapper for the Formatting of the UserForm which can be duplicated and adjusted
  • Make a UserForm and/or any of its Controls Draggable using 'Self.Drag()'
  • Remove the Caption and/or Borders of a UserForm using 'Self.RemoveCaptionAndBorders'
  • Let any instances of the UserForm Message Notification Boxes be destroyed upon the selection of another Worksheet using 'Self.UnloadOnDeactivate = True'
  • Use 'Self.Quit' to exit any instances of the UserForms
  • Change the Mouse Cursor when over the UserForm and/or any of its Controls using 'Self.ChangeCursor IDC_HAND'. THis is a lovely effect as you go to hover over a Button for example
  • Create a MouseOver Button effect easily by using 2 Labels and a tiny snippet of Code in the Button_MouseMove() event within the UserForm Code Module, 'Self.MouseOver Me.Button, Me.ButtonMouseOver'. That's it, just one line
  • Create a tiny Pause in Milliseconds using 'Self.Pause 50'
  • Choose from 1 of 4 different Notification Boxes, Critical, Info, Success and Warning and display one or all of them at once
  • Add UserForm Borders in any Colour using RGB values
  • Fade in 2 Controls from one background colour to another to create a MouseOver effect
  • Add a Drop Shadow to your Notification Boxes by default so that if the Form is selected or in focus a DropShadow will persist and then if the Worksheet is selected or the Form loses focus it will be removed
  • Remove Captions, Borders and set Transparency using 'Self.RemoveCaptionBordersAndSetTransparency()'
  • A Frame Timer
  • Simple functions to extract RGB values from a Long value and convert each part back into a Long value
  • Lots of Demos included to show you what Form is capable of
  • The option to omit a Wrapper Function and simply control the Form style directly - see the Usage Section in this online documentation
  • You can display a Modal Dialog over a normal Dialog - remember to set the 'new' Keyword on the Modal one though

Credits

Concept, layout of the 4 Forms, including Colours and the Notification Text was derived from a free resource TETHR-PSD by InVision
Excel Background Design by Mark Kubiszyn



Installation

Open the 'Form.xlsm' file and click on all of the Hyperlinks to see Form Notification MsgBoxes popup. You can click on multiple Hyperlinks to overlay the Dialogs

To use Form in your own Projects open the 'Form.xlsm' file and your own Macro-enabled Project. Then open the VBE (Visual Basic Editor) and drag the 'IForm' Class Code Module and the 'mdForm' standard Code Module into your own Macro-enabled file. Now add a Button and link it to one of the Subroutines. Configure as per the Usage Section in this online documentation

Please read all of the online documentation before you begin to create your own Form Notification MsgBoxes or before turning to Support


Usage

How to use Form


Abstract
Form is designed to allow you to use any base UserForm design you may have and then use the 'IForm' Class to add some extensibility to it, for example, perhaps you want to allow the UserForm to be dragged or you don't want a Caption or Borders, or maybe you want a MouseOver Button with an RGB fade, well, Form allows you to easily accomplish this and much more

Adding the IForm Class
This part is easy. Open the 'Form.xlsm' file and your own Macro-enabled Project. Then open the VBE (Visual Basic Editor) and drag the 'IForm' Class Code Module into your own Macro-enabled file

Adding Code to your Base UserForm Design
So, you have a UserForm that you want to use with Form. Go into the UserForm Code Module and add the following at the top of the Code Module - you should already have the line 'Option Explicit'!
Option Explicit

Private Self As New IForm
Now in the UserForm_Initialize() Event add the following Code which is required!
Private Sub UserForm_Initialize()
   ' required!
   Set Self.Interface = Me
End Sub
Now you have attached the Interface Object to your UserForm. In the UserForm_MouseDown() Event (add this if you haven't got a declaration as per below) add the following Code to make the UserForm fully draggable. Using this Code line you can make any Control of the UserForm draggable as well should you wish:
Private Sub UserForm_MouseDown(ByVal Button As Integer, ByVal Shift As Integer, ByVal X As Single, ByVal Y As Single)
   ' allows any Object to be draggable
   Self.AllowDrag
End Sub
If you have a Label that you also wish to be draggable then you can add the following Code to the Label's MouseDown() Event - I have a Label called Message which ships with the Form download File:
Private Sub Message_MouseDown(ByVal Button As Integer, ByVal Shift As Integer, ByVal X As Single, ByVal Y As Single)
   Self.AllowDrag
End Sub
To remove a UserForm's Caption/Titlebar and Borders you can use the following Code in the UserForm_Activate() Event:
Private Sub UserForm_Activate()
   Self.RemoveCaptionAndBorders
End Sub
See, this is too easy right? You bet.

The Form Wrapper
So Form utilises a simple wrapper Subroutine to display its UserForms. You don't have to use a wrapper, but the reason I do this is that you can then very easily create new wrappers for specific new UserForm designs otherwise you would have to pass all of the UserForm Control Names and Colour settings into the Class for each new design. So this makes it really easy to create new designs. The standard Call to display a Form is as follows (the use of 'chr$(10' is to provide a return or new line between text):
Public Sub CriticalForm()
   Form Critical, "Oh Snap!" & Chr$(10) & Chr$(10) & "Change a few things up and try submitting again"
End Sub
Named Arguments that can be passed include, Theme (1 of 4, Critical, Info, Success and Warning), Msg (your message text), Modal (whether or not to display the Form as a Modal Dialog, default is False), Spawn (whether or not to create new instances, default is False), BorderStyle (True = Border, False = no Border, default is False) and BorderColour (an RGB Colour Value):
Public Sub WarningModal()
   Form Theme:=Warning, _
         Msg:="Warning!" & Chr$(10) & Chr$(10) & "Best check yo self, you’re not looking too good", _
         Modal:=True, _
         Spawn:=True, _
         BorderStyle:=True, _
         BorderColour:=RGB(60, 66, 72)
End Sub
And finally the Wrapper for the Form which is added to a standard Code Module and can be easily adapted for any UserForm design:
' Form, Wrapper for an IForm
Private Sub Form(ByVal Theme As TFormTheme, ByVal Msg As String, _
                 Optional ByVal Modal As Boolean = False, _
                 Optional ByVal Spawn As Boolean = False, _
                 Optional BorderStyle As Boolean = False, Optional BorderColour As Long = xlNone)

   Dim F As IForm
   Set F = New IForm
   
   With F
      If Spawn Then Set .Interface = New UserForm1 Else Set .Interface = UserForm1
      With .Interface
         .BorderStyle = IIf(BorderStyle, 1, 0)
         If BorderColour <> xlNone Then .BorderColor = BorderColour
         Select Case Theme
      
         Case Critical:
            .BackColor = RGB(223, 71, 61)
            .Button.BackColor = RGB(201, 64, 55)
            .ButtonMouseOver.BackColor = RGB(157, 50, 43)
         Case Info:
            .BackColor = RGB(27, 87, 255)
            .Button.BackColor = RGB(24, 78, 230)
            .ButtonMouseOver.BackColor = RGB(19, 61, 179)
         Case Success:
            .BackColor = RGB(33, 191, 99)
            .Button.BackColor = RGB(30, 172, 89)
            .ButtonMouseOver.BackColor = RGB(23, 134, 69)
         Case Warning:
            .BackColor = RGB(247, 147, 29)
            .Button.BackColor = RGB(223, 133, 26)
            .ButtonMouseOver.BackColor = RGB(173, 103, 20)
      
         End Select
      
         .Message.Font.Name = "Tahoma"           
         .Button.Font.Name = "Tahoma"            
         .ButtonMouseOver.Font.Name = "Tahoma"   
         
         .Message.Font.Size = 14
         .Button.Font.Size = 14
         .ButtonMouseOver.Font.Size = 14
         
         .Message.ForeColor = vbWhite
         .Button.ForeColor = vbWhite
         .ButtonMouseOver.ForeColor = vbWhite
      
         .Message = Msg
         .Show IIf(Modal, 1, 0)
      End With
   End With

End Sub
A Form Screen Shot:



Of course you don't have to use a Wrapper function with Form. So I also add in a Standalone() Subroutine like this to display a different style of Notification:
' Standalone, you don't have to use a Wrapper - you can just use the Form like this
Public Sub Standalone()

   Dim F As IForm
   Set F = New IForm
   
   With F
      Set .Interface = UserForm1
      With .Interface
         .BorderStyle = 1
         .BorderColor = RGB(31, 33, 34)
         .BackColor = RGB(87, 211, 251)
         .Button.BackColor = RGB(27, 114, 190)
         .ButtonMouseOver.BackColor = RGB(10, 94, 130)
     
         .Message.Font.Name = "Consolas"
         .Button.Font.Name = "Consolas"
         .ButtonMouseOver.Font.Name = "Consolas"
         
         .Message.Font.Size = 14
         .Button.Font.Size = 14
         .ButtonMouseOver.Font.Size = 14
         
         .Message.ForeColor = vbWhite
         .Button.ForeColor = vbWhite
         .ButtonMouseOver.ForeColor = vbWhite
      
         .Button.Caption = "Understood!"
         .ButtonMouseOver.Caption = "Understood!"
         .ButtonMouseOver.ControlTipText = "Okay I understand you, great stuff!"
         .Message = "Hello World!" & Chr$(10) & Chr$(10) & "You can modify Form Font, Colours, Borders and Text"
         .Show 0
      End With
   End With

End Sub






Screen Shots

A Screenshot of a Success Form with Border, DropShadow and alternative Comfortaa Font



A Screenshot of all of the Bordered Message Notifications for Form using 3 Labels on a Single base UserForm



A Screenshot of the Warning Message



A Screenshot of a Standalone Form that doesn't use the Wrapper Function in Blue



A Screenshot of a Standalone Form that doesn't use the Wrapper Function in Pink





FAQ

* There are no frequently asked questions for Form




Form Videos

This is a video of the Form Demos. Here we will create single and multiple instances of Form from a base instance of a standard UserForm which has 3 Labels, one for the Message and 2 others for the Button and MouseOver Button. Music is 'Anxiety - NEFFEX' (Caution: music may contain explicit lyrics - listen at your own risk). View this video on YouTube



Shorts & Reels



Support

Support is 100% optional and I provide it for your convenience, so please be patient, polite and respectful

Support for my Software

  • Responding to questions or problems regarding the Software and its features
  • Fixing valid (replicated) bugs and reported issues for the VERSION I HAVE WRITTEN

Software support does not include

  • Customization and installation services
  • Support for third party software or ANY kind of development whatsoever

Before seeking support

  • Make sure your question is a valid Software Issue and not a customization request
  • Make sure you have read through the FAQ's, online documentation and any related video guides before asking support on how to accomplish a task
  • Ensure that you access to the VBOM is allowed and that Macros can run in Excel
  • Make sure to provide 'proof of purchase' and state the name / version of the Software that you are having issues with when requesting support by Email or via Facebook

How to get Support

Contact Mark Kubiszyn on the Email address provided when you purchased the Software, including the Order Number
Remember to be patient, if there has been an issue with your download, Mark will always respond within 48 hours and will Email you the File directly if neccessary. For other issues the response time may be considerably longer and I may choose to respond to specific questions only (as is my right), depending on what has been asked

Future Builds

* No ideas as yet!

Bug Fixes

* There are currently no bugs identified for Form

Credits

Concept and Design

Concept, layout of the 4 Forms, including Colours and the Notification Text was derived from a free resource TETHR-PSD by InVision
Excel Background Design by Mark Kubiszyn

Changelog

Read more information on the status of each release below. The latest Version including a description of any changes is shown first

12.12.2023 - (Version 1)

General release of Form for Excel