Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I am an ultra novice and am trying to teach myself VBA using "Excel
VBA Programming for Dummies". I have attempted to insert some of the sample code provided in the book. I appear to get the same error message when I execute the code, “compile error: variable not defined”. The two examples I have used are below. I was hoping you might be able to tell me what I am doing incorrectly. Thank you. EXAMPLE 1 Sub GuessName() Msg = "Is your name " & Application.UserName & "?" Ans = MsgBox(Msg, vbYesNo) If Ans = vbNo Then MsgBox "Oh, never mind." If Ans = vbYes Then MsgBox "I must be clairvoyant!" End Sub Example 2 Answer = MsgBox("Convert formulas to values?", vbYesNo) If Answer < vbYes Then Exit Sub Selection.Copy Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _ :=False, Transpose:=False Application.CutCopyMode = False |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Compile Error: Variable Not Defined | Excel Programming | |||
Compile Error: variable not defined | Excel Programming | |||
Variable not Defined Compile error | Excel Programming | |||
Variable not defined compile error | Excel Programming | |||
Compile error, variable not defined | Excel Programming |