Need an example of a simple VB Form

Some videos you may like

Excel Facts

Move date out one month or year
Use =EDATE(A2,1) for one month later. Use EDATE(A2,12) for one year later.

Norie

Well-known Member
Joined
Apr 28, 2004
Messages
76,061
Office Version
  1. 365
Platform
  1. Windows
Paula

What exactly do you mean?

To create a userform just goto the VBA Editor(ALT+F11) and then Insert>Userform.

You should now have a blank userform which you can add controls/code to.
 

HalfAce

MrExcel MVP
Joined
Apr 6, 2003
Messages
9,453
Hello Paula,
What Norie means is:
(1) Press Alt+F11. (Opens the VB Editor)
(2) From the menu choose Insert & UserForm

You will now have a "blank slate" of a userform to which you can add your controls. - (from the toolbox - If it's not showing choose View & Toolbox)

You can add code to the controls as you go.

UserForms in general are not that hard to learn but there are quite a few little steps to take and options available to you so they can seem rather daunting at first.


And oh yeah. (just for fun) to answer the question your signature quote asks, try something like this in your sheet code module.
Code:
Private Sub Worksheet_Change(ByVal Target As Range)
If Intersect(Target, Columns(6)) Is Nothing Then Exit Sub
If Target.Count > 1 Then Exit Sub
If Target.Value > 0 Then
    Application.EnableEvents = False
    With Range("A1")
        hold = .Value
        .Value = -1
        .Copy
        Target.PasteSpecial Paste:=xlValues, Operation:=xlMultiply
        .Value = hold
    End With
    With Application
        .CutCopyMode = False
        .EnableEvents = True
    End With
End If
End Sub
:biggrin:
 

Watch MrExcel Video

Forum statistics

Threads
1,118,811
Messages
5,574,449
Members
412,595
Latest member
slim313
Top