VBA MsgBox Excel Examples Macros Various Message Box Types options

Home/VBA/VBA MsgBox Excel Examples Macros Various Message Box Types options

VBA MsgBox Excel Examples with Various Message Box Types options with Macros codes and syntax for yes no and other advanced popup message to display icons command buttons. VBA MsgBox in Excel is one of the most frequently used functions in VBA Macros and Examples. VBA MsgBox function displays a message, optional icon, and selected set of command buttons in a dialog box. It waits for the user to click a button, and returns an Integer indicating which button the user clicked. Here is the syntax and different kinds of MsgBox in VBA. We will see the different options and usage of msgbox like: yes no syntax, arguments, parameters, yes no default buttons, yes no prompt, yes no example, yes no if, yes no return, yes no answer, yes no access, yes no cancel values, yes no response, yes no cancel, variable string, yes no Button Types, yes no critical, yes no warning, yes no exclamation, yes no question, button caption, button labels, button names, if then and exit sub, help button, without ok button, without buttons, no buttons, variable value, variable text, variable input, buttons and icons, button buttons, hello world, multiple lines, access custom buttons, command button, bold text in, radio buttons, access new line, access carriage return, variable type, variable, error handling, on error goto, error message dialog box, display array, two lines, access multiple lines.

PREMIUM TEMPLATES LIMITED TIME OFFER

ON SALE80% OFF

50+ Project Management Templates Pack
Excel PowerPoint Word

Advanced Project Plan & Portfolio Template
Excel Template

Business Presentations Templates Pack
PowerPoint Slides

20+ Excel Project Management Pack
Excel Templates

20+ PowerPoint Project Management Pack
PowerPoint Templates

10+ MS Word Project Management Pack
Word Templates


VBA MsgBox in Excel – Syntax:

Here is the synatax of VBA MsgBox or Message Box Function in Excel.

MsgBox(prompt

[, buttons] [, title] [, helpfile, context])

VBA MsgBox in Excel VBA Syntax

Where

  1. Prompt: It Contains String expression displayed as the message in the dialog box. The Maximum length of Prompt is 1024 Characters. You can use carriage return Character,If prompt consists more than one line.
  2. buttons:It Contains Numeric value specifying the number and type of buttons to display.The default button value is 0.
  3. title:It Contains String expression displayed in the title bar of the dialog box.

VBA MsgBox in Excel VBA – Example Cases:

Here is a short video to show you message box with different types of options:

Here are the different types of Message Boxes available in Excel VBA. You can click on each link to see the respective examples, Screenshots of output and explanation.

VBA MsgBox arguments

MsgBox will take the following parameters:
‘Prompt: This is the message text which you want to show/prompt
‘Buttons Style: This is the type of message box which you want to show, like Yes No buttons with Information Icon
‘Title: This is the title of the message box window
‘Help File, and Context are the other optional paramerter which we use in very rare
‘Here is the example
MsgBox “Here you can enter text to show”, vbYesNo + vbInformation, “This is Title”
‘The above MsgBox will show you Yes No Type message box with information icon and title.

Excel VBA MsgBox Yes No Syntax

The following is the simple Example on VBA MsgBox Yes No Prompt Type:
MsgBox “This is the example Yes No Syntax”, vbYesNo

VBA MsgBox Yes No If

The following example on vba msgbox yes no if to show the different messages boxes based on the selected option.
If MsgBox(“Do you want to see know the current Time”, vbYesNo) = vbYes Then
MsgBox Format(Now(), “HH:MM:SS AMPM”), vbInformation, “Current Time”
End If

VBA Message Box New line,carriage return, two lines, multiple line

We can use vbCr to split the message box text into a new line, carriage return, two lines or multiple lines.
MsgBox “Hello, This is Line ONE” & vbCr & “This is Line TWO”

VBA MsgBox Yes No Cancel Return

The below example on vba msgbox yes no cancel return to access the response of MsgBox. This will help us to access,store and input the msgbox response or string in variable value. We can use this variable text in the further programming.

Dim msgValue
msgValue = MsgBox(“Hello, Are you a graduate? Choos:” _
& vbCr & “Yes: if you are a graduate” _
& vbCr & “Yes: if you are Not a graduate” _
& vbCr & “Yes: if you are Not Intrested” _
, vbYesNoCancel + vbQuestion)

If msgValue = vbYes Then
MsgBox “You are eligible for applying for this Job”
ElseIf msgValue = vbNo Then
MsgBox “You are NOT eligible for applying for this Job”
ElseIf msgValue = vbCancel Then
MsgBox “No Problems, We will find suitable job for you”
End If

VBA If Then MsgBox and Exit Sub

Some times we may want to ask user to continue further, other wise skip the execution of next program. The below example on VBA if then msgbox and exit sub will help you to do this:

If MsgBox(“Would you like to continue…?”, vbQuestion + vbYesNo) <> vbYes Then
Exit Sub
End If
You can write the next programming steps here… This will execute if user selects No in the above prompt.

VBA On Error GoTo Message Box for Error Handling

MsgBox is also useful in error handling. We can tell vba on error goto a lable and show message box with error number and description. The below code will execute the code and show the error number and description if there is any run-time error.

On Erro GoTo ErrorHanMsg1
‘Your code goes here….

Exit Sub
‘This comes before End Sub or End Function Statement
ErrorHanMsg1:
MsgBox Err.Number & vbCr & Err.Description

VBA MsgBox:vbOKOnly

Please find the following code and output. It will Display OK button only. When we click OK button, It will return value 1 as a output.

Code:
Sub MessageBox_vbOKOnly()
'Variable Declaration
Dim OutPut As Integer
'Example of vbOKOnly
OutPut = MsgBox("Thanks for visiting mongopono.ru!", vbOKOnly, "Example of vbOKOnly")
End Sub
Output:

Top

VBA MsgBox: vbOKCancel MessageBox

Please find the following code and output. It will Display OK and Cancel buttons. When we click OK button, It will return value 1 as a output.And When we click Cancel button, It will return value 2 as a output.

Code:
Sub MessageBox_vbOKCancel()
'Variable Declaration
Dim OutPut As Integer
'Example of vbOKCancel
OutPut = MsgBox("You are VBA Expert, is it True?", vbOKCancel, "Example of vbOKCancel")
If OutPut = 1 Then
'Output = 1(Ok)
MsgBox "Grate! You are VBA Expert, You can learn Advanced Our VBA!",, "Ok - 1"
Else
'Output = 2(Cancel)
MsgBox "You can Star Learning from Basics!",, "Cancel - 2"
End If
End Sub
Output:

Top

VBA MsgBox: vbAbortRetryIgnore

Please find the following code and output. It will Display Abort, Retry, and Ignore buttons. When we click Abort button, It will return value 3 as a output. When we click Retry button, It will return value 4 as a output.And When we click Ignore button, It will return value 5 as a output.

Code:
Sub MessageBox_vbAbortRetryIgnore()
'Variable Declaration
Dim OutPut As Integer
'Example of vbAbortRetryIgnore
OutPut = MsgBox("The Connection has failed. Do you want to Continue?", vbAbortRetryIgnore, "Example of vbAbortRetryIgnore")
If OutPut = 3 Then
'Output = 1(Abort)
MsgBox "Abort!",, "Abort - 3"
ElseIf OutPut = 4 Then
'Output = 4(Retry)
MsgBox "Retry!",, "Retry - 4"
Else
'Output = 5(Ignore)
MsgBox "Ignore!",, "Ignore - 5"
End If
End Sub
Output:

Top

VBA MsgBox in Excel: vbYesNoCancel MessageBox

Please find the following code and output. It will Display Yes, No, and Cancel buttons. When we click Yes button, It will return value 6 as a output. When we click No button, It will return value 7 as a output.And When we click Cancel button, It will return value 2 as a output.

Code:
Sub MessageBox_vbYesNoCancel()
'Variable Declaration
Dim OutPut As Integer
'Example of vbYesNoCancel
OutPut = MsgBox("File already exists. Do you want to replace?", vbYesNoCancel, "Example of vbYesNoCancel")
If OutPut = 6 Then
'Output = 6(Yes)
MsgBox "Yes!", vbInformation, "Yes - 6"
ElseIf OutPut = 7 Then
'Output = 7(No)
MsgBox "No!", vbInformation, "No - 7"
Else
'Output = 2(Cancel)
MsgBox "Cancel!", vbInformation, "Cancel - 2"
End If
End Sub
Output:

Top

VBA MsgBox: vbYesNo

Please find the following code and output.It will display Display Yes and No buttons. When we click Yes button, It will return value 6 as a output.And, When we click No button, It will return value 7 as a output.

Code:
Sub MessageBox_vbYesNo()
'Variable Declaration
Dim OutPut As Integer
'Example of vbYesNo
OutPut = MsgBox("Do you want to replace the existing file?", vbYesNo, "Example of vbYesNo")
If OutPut = 6 Then
'Output = 6(Yes)
MsgBox "Yes! Replace the file", vbInformation, "Yes - 6"
Else
'Output = 7(No)
MsgBox "No! Don't replace the file",, "No - 7"
End If
End Sub
Output:

Top

MsgBox in Excel VBA: vbRetryCancel MessageBox

Please find the following code and output. It will Display Retry and Cancel buttons.When we click Retry button, It will return value 4 as a output.And, When we click Cancel button, It will return value 2 as a output.

Code:
Sub MessageBox_vbRetryCancel()
'Variable Declaration
Dim OutPut As Integer
'Example of vbRetryCancel
OutPut = MsgBox("Close the File.Try Again?", vbRetryCancel + vbDefaultButton2, "Example of vbRetryCancel")
If OutPut = 4 Then
'Output = 4(Retry)
MsgBox "Retry!",, "Retry - 4"
Else
'Output = 2(Cancel)
MsgBox "Cancel It!",, "Cancel - 2"
End If
End Sub
Output:

Top

VBA MsgBox: vbCritical

Please find the following code and output. When we click Ok button, It will return value 1 as a output. And, It will display critical Message Icon.

Code:
Sub MessageBox_vbCritical()
'Variable Declaration
Dim OutPut As Integer
'Example of vbCritical
OutPut = MsgBox("Please enter valid Number!", vbCritical, "Example of vbCritical")
End Sub
Output:

Top

VBA MsgBox: vbQuestion

Please find the following code and output.When we click Ok button, It will return value 1 as a output. And, It will display Warning Query icon.

Code:
Sub MessageBox_vbQuestion()
'Variable Declaration
Dim OutPut As Integer
'Example of vbQuestion
OutPut = MsgBox("Are you fresher?", vbQuestion, "Example of vbQuestion")
End Sub
Output:

Top

VBA MsgBox: vbExclamation

Please find the following code and output.When we click Ok button, It will return value 1 as a output. And, It will display Warning Message icon.

Code:
Sub MessageBox_vbExclamation()
'Variable Declaration
Dim OutPut As Integer
'Example of vbExclamation
OutPut = MsgBox("Input Data is not valid!", vbExclamation, "Example of vbExclamation")
End Sub
Output:

Top

VBA MsgBox: vbInformation

Please find the following code and output.When we click Ok button, It will return value 1 as a output. And, It will display Information Message icon.

Code:
Sub MessageBox_vbInformation()
'Variable Declaration
Dim OutPut As Integer
'Example of vbInformation
OutPut = MsgBox("Succesessfully Completed the Task.", vbInformation, "Example of vbInformation")
End Sub
Output:

Top

VBA MsgBox: vbDefaultButton1

Please find the following code and output. By Default it will focus on first (Retry) Button. When we press enter it will result the value of Retry button as 4.

Code:
Sub MessageBox_vbDefaultButton1()
'Variable Declaration
Dim OutPut As Integer
'Example of vbDefaultButton1
OutPut = MsgBox("Close the File.Try Again?", vbRetryCancel + vbDefaultButton1, "Example of vbDefaultButton1")
End Sub
Output:

Top

VBA MsgBox: vbDefaultButton2

Please find the following code and output.By Default it will focus on Second(Cancel) Button. When we press enter it will result the value of Retry button as 2.

Code:
Sub MessageBox_vbDefaultButton2()
'Variable Declaration
Dim OutPut As Integer
'Example of vbDefaultButton2
OutPut = MsgBox("Close the File.Try Again?", vbRetryCancel + vbDefaultButton2, "Example of vbDefaultButton2")
End Sub
Output:

Top

VBA MsgBox: vbDefaultButton3

Please find the following code and output.By Default it will focus on Third(Cancel) Button. When we press enter it will result the value of Retry button as 2.

Code:
Sub MessageBox_vbDefaultButton3()
'Variable Declaration
Dim OutPut As Integer
'Example of vbDefaultButton2
OutPut = MsgBox("Close the File.Try Again?", vbYesNoCancel + vbDefaultButton3, "Example of vbDefaultButton3")
End Sub
Output:

Top

VBA MsgBox: vbApplicationModal

Please find the following code and output.The user must respond to the message box before continuing work in the current application.

Code:
Sub MessageBox_vbApplicationModal()
'Variable Declaration
Dim OutPut As Integer
'Example of vbApplicationModal
OutPut = MsgBox("Thanks for visiting mongopono.ru!", vbApplicationModal, "Example of vbApplicationModal")
End Sub
Output:

Top

VBA MsgBox: vbSystemModal

Please find the following code and output.All applications are suspended until the user responds to the message box.

Code:
Sub MessageBox_VbMsgBoxSetForeground()
'Variable Declaration
Dim OutPut As Integer
'Example of vbApplicationModal
OutPut = MsgBox("Thanks for visiting mongopono.ru!", vbMsgBoxSetForeground, "Example of VbMsgBoxSetForeground")
End Sub
Output:

Top

VBA MsgBox: vbMsgBoxHelpButton

Please find the following code and output.Adds Help button to the message box.

Code:
Sub MessageBox_vbMsgBoxHelpButton()
'Variable Declaration
Dim OutPut As Integer
'Example of vbMsgBoxHelpButton
OutPut = MsgBox("Thanks for visiting mongopono.ru!", vbMsgBoxHelpButton, "Example of vbMsgBoxHelpButton")
End Sub
Output:

Top

VBA MsgBox: VbMsgBoxSetForeground

Please find the following code and output.Specifies the message box window as the foreground window.

Code:
Sub MessageBox_VbMsgBoxSetForeground()
'Variable Declaration
Dim OutPut As Integer
'Example of vbApplicationModal
OutPut = MsgBox("Thanks for visiting mongopono.ru!", vbMsgBoxSetForeground, "Example of VbMsgBoxSetForeground")
End Sub
Output:

Top

VBA MsgBox: vbMsgBoxRight

Please find the following code and output.Here text is right aligned.

Code:
Sub MessageBox_vbMsgBoxRight()
'Variable Declaration
Dim OutPut As Integer
'Example of vbMsgBoxRight
OutPut = MsgBox("Input Data is not valid!", vbMsgBoxRight, "Example of vbMsgBoxRight")
End Sub
Output:

Top

VBA MsgBox: vbMsgBoxRtlReading

Please find the following code and output.It Specifies text should appear as right-to-left reading on Hebrew and Arabic systems.

Code:
Sub MessageBox_vbMsgBoxRtlReading()
'Variable Declaration
Dim OutPut As Integer
'Example of vbMsgBoxRtlReading
OutPut = MsgBox("Thanks for visiting mongopono.ru!", vbMsgBoxRtlReading, "Example of vbMsgBoxRtlReading")
End Sub
Output:

Instructions:
  1. Open an excel workbook
  2. Press Alt+F11 to open VBA Editor
  3. Double click on ThisWorkbook from Project Explorer
  4. Copy the above code and Paste in the code window
  5. Press F5
  6. You should see the above output

Custom Message Box in Excel VBA:

What if your requirement is not achievable with the available types of MessageBox. You Can create your own MessageBox using Forms in Excel VBA. You can design your own custom MessageBox using Form Controls.
Here is the example Custom MessageBox.

Top

MessageBox Constants in Excel VBA:

Please find the following table for button argument values:

Constant Value Description
vbOKOnly 0 It Display’s OK button only.
vbOKCancel 1 It Display’s OK and Cancel buttons.
vbAbortRetryIgnore 2 It Display’s Abort, Retry, and Ignore buttons.
vbYesNoCancel 3 It Display’s Yes, No, and Cancel buttons.
vbYesNo 4 It Display’s Yes and No buttons.
vbRetryCancel 5 It Display’s Retry and Cancel buttons.
vbCritical 16 It Display’s Critical Message icon.
vbQuestion 32 It Display’s Warning Query icon.
vbExclamation 48 It Display’s Warning Message icon.
vbInformation 64 It Display’s Information Message icon.
vbDefaultButton1 0 Here first button is default.
vbDefaultButton2 256 Here second button is default.
vbDefaultButton3 512 Here third button is default.
vbDefaultButton4 768 Here fourth button is default.
vbApplicationModal 0 Application modal. The user must respond to the message box before continuing work in the current application.
vbSystemModal 4096 System modal. In this case all applications are suspended until the user responds to the message box.
vbMsgBoxHelpButton 16384 Adds Help button to the message box.
VbMsgBoxSetForeground 65536 Specifies the message box window as the foreground window.
vbMsgBoxRight 524288 Text is right aligned.
vbMsgBoxRtlReading 1048576 Specifies text should appear as right-to-left reading on Hebrew and Arabic systems.

Top

MessageBox Return Constants and Enumerations in Excel VBA:

Constant Value Description
vbOK 1 OK
vbCancel 2 Cancel
vbAbort 3 Abort
vbRetry 4 Retry
vbIgnore 5 Ignore
vbYes 6 Yes
vbNo 7 No

Top

LIMITED TIME OFFER
By |August 25th, 2013|VBA|16 Comments

About the Author:

Excel VBA Developer having around 8 years of experience in using Excel and VBA for automating the daily tasks, reports generation and dashboards preparation. Valli is sharing to helps us automating daily tasks.

16 Comments

  1. Shady Mohsen January 21, 2014 at 11:02 PM - Reply

    Thanks friend. It helped me a lot.I appreciate your efforts on creating useful VBA codes.

  2. ramana January 31, 2015 at 11:57 PM - Reply

    nice post..
    is there any suggestion how to display message box from the statement ‘For – Next’, but the message itself does not appear repeatedly based on that ‘For-Next’ values?

    • PNRao February 3, 2015 at 10:14 PM - Reply

      Hi Ramana,
      You can use a Boolean variable to do this:

      Sub ShowMsgOnceInForLoop()
      Dim msgFlag As Boolean
      msgFlag = False
      For iCntr = 1 To 100
      If msgFlag = False Then
      MsgBox "This is MSGBox"
      msgFlag = True
      End If
      Next
      End Sub
      

      Instead of this flag, you may use any other condition when you want to show the Message box.

      Thanks-PNRao!

  3. Dilip March 4, 2015 at 1:46 PM - Reply

    i want to replace MsgBox appearing for Data Validation – Input & Error Message. I want to skip Help Button in Excel Default Message and add our own Message Title. Is there any way to do this ? Pl. provide VBA code only. Don’t waste your time in explaining how this can be done through Ribbon Menu pl. I will be highly obliged if i get the solution asap.If you require further information pl. let me know asap.

    • PNRao March 7, 2015 at 7:34 PM - Reply

      Hi Dilip,

      Please see the below VBA example code for Data validation and Custom mesagebox.

      Sub sbCustomDatavalidation()
      With Range("A1:A5").Validation
      .Delete
      .Add Type:=xlValidateWholeNumber, AlertStyle:=xlValidAlertStop, _
      Operator:=xlBetween, Formula1:="1", Formula2:="5"
      .IgnoreBlank = True
      .InCellDropdown = True
      .InputTitle = "Enter #Items"
      .InputMessage = "Enter an value between 1 to 5"
      .ErrorTitle = "My Message Box title"
      .ErrorMessage = "My Message Box Description"
      .ShowInput = True
      .ShowError = True
      End With
      End Sub
      

      Thanks-PNRao!

  4. Paul April 14, 2015 at 11:43 PM - Reply

    Hey Valli, Great article!

    I was wondering … I’d like a box to pop up for one second (or other time period), then dismiss itself without user interaction.
    Can msgbox be made to do this, or is there a different command that could do this?
    Thanks

  5. pratyush December 26, 2015 at 9:10 PM - Reply

    I learned so many things from all above.Thanks and please stay-Tuned.
    All the VBA beginners like me are refering all these and its very helpful.

    Thanks Again. .

  6. Csaba March 2, 2016 at 6:01 PM - Reply

    How I can stop the “X” button from the upper right corner to close the msgbox, practically force the user to respond with assigned buttons. Something similar with UserForm_QueryClose(Cancel As Integer, CloseMode As Integer), cancel = false, and post a message.

  7. Stephen Nzai September 6, 2016 at 7:40 PM - Reply

    Can someone tell me how to put the displaced value on a message box on a cell. Lets say the message box displays integer 5, how do I get it on a cell without typing it?

  8. sambit September 15, 2016 at 10:56 AM - Reply

    i need VBA code so that i can get an alert when a cell in excel exceeds certain specified number which is automatically populated by the server

    • Gregory Feeney May 27, 2017 at 8:29 PM - Reply

      Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target As Range)
      Dim MyValue As String
      ‘Set MyValue to whatever you want
      MyValue = 1

      ‘Set the Range to what ever cell you want to monitor changes

      If Range(“A1”) > MyValue Then
      MsgBox “Alert Box Appears”
      End If

      End Sub

  9. Bob November 8, 2016 at 2:25 AM - Reply

    Funny everyone illustrates how to add a help button, but no one will attempt to demonstrate how to get the help button to display help. The help button example above works great and pops up an empty help file. However if you add the next parameter, the help file path, vbscript complains – “Invalid procedure call or arguments: MsgBox”. The “.chm” file I tested with works great if you click on the file directly. Does this mean that not all .chm help files are windows compatible or is MsgBox broken.

  10. ParismaX February 14, 2017 at 6:03 PM - Reply

    I was wondering if I could make a message box display the user’s name.
    I know it is possible to do this but how would I go about it?

    • June 4, 2017 at 5:56 PM - Reply

      Sub DisplayUserName()
      msgBox “The User Name is: ” & Environ(“UserName”),vbInformation,”User Name”
      End Sub

    • Colin Riddington June 17, 2017 at 3:30 AM - Reply

      You can use the Environ function to get the logged on user name

      e.g. MsgBox “Hello ” & Environ(“UserName”),vbExclamation,”MsgBox Title”

      However the user name may not give the person’s forename.
      Otherwise use DLookup to find the forename in a table.
      e.g. If you have a table tblUsers with logged user info including a field called Forename and UserID stored as a string strUserID, you could use DLookup something like this:

      MsgBox “Hello ” & DLookup(“Forename”,”tblUsers”,”UserID”= ‘” & strUserID & “‘”),vbExclamation,”MsgBox Title”

  11. Ariful Romadhon August 5, 2017 at 3:54 PM - Reply

    Could you help me please?
    I want to make message box for validating surveys.
    the message box contain the message because error of stuffing

    I want my message box keep showing, so i can click the sheets which contain error of stuffing without closing the message box.

    So, the message box will guide me to fix the error in that sheets

    This is my previous code:

    Dim error As String
    error = “”

    If (vehicle = True) And (gasoline_month = 0) Then
    error = error & “- the expenditure of gasoline should not be empty” & Chr(10)
    End If

    If error = “” Then msgbox “clean”, vbInformation Else MsgBox error, vbCritical
    End Sub

    Thank you, I hope anyone can help me,,
    (sorry for my bad english)

Leave A Comment


Related pages


pyramid powerpoint templateexcel find duplicate rowssas macro loopssample project tracking spreadsheethow to delete sheets in excelexcel run macro on saveinserting check box in excelshortcut key for next sheet in exceldate diff excelinterior.colorindexisempty excel vbacopyfile vbaxls vlookup exampleexcel beginners tutorialworksheet unprotectmacro to consolidate data from multiple worksheetsdownload data mining add in for excel 2013vba message box examplevba for each cell in rangeleft function vbachange a row to a column in excelvb script excellearn macro excelexcel macro msgboxhow to join cells in excelusing data validation in excel 2010how to insert a filter in excelexcel odbc sql querysql query excel spreadsheetvb code for excelmacro in excel with exampleexcel macro file extensionenable macro exceldo while statement vbavba filtersremove hyperlinks excel 2007excel protect with passwordexcel vba worksheet activateexcel save macrocolour index excelexcel powerpivot tutorialproject plan template excelexcel 2010 name managertelecom interview questions and answers pdfexcel vba interiorhow to use count if function in excelqlikview for dummiesexcel vba color cellcreating dynamic charts in excelaptitude and technical test questions and answersfor loop vba excelmerge tabs in excelvba excel option buttonexcel vba colorvba workbook objecthow to automate graphs in excelsql identify duplicatesexcel 2007 countifshow to create an hyperlink in excelwriting excel macros for beginnersexcel vba collectionssimple macros in excelproject workbook templatevba range selectionautofit row height not workingsurface chart excelhow to write a query in excelcreating a macro excelvb6 questions and answersexcel 2010 developer modeauto alphabetize in excelvbscript to delete filesbreak password protected excelifs function in excelbusiness analyst interview questions and answers for freshersvba labelexcel vba lookupvba case else