Vba view code developer tab in Excel

The View Code button is contained in the Controls group of the developer Tab.

This button is used to view or modify the code associated with the controls embedded in the sheet, which are highlighted.

Also, this button can be used to view macro code other than that are related to ActiveX controls.

The following figure shows the "View Code" button.

excel vba view code developer tab

For illustration purpose, let us put a button control as shown below and associate a simple code to it.

The following is the code associated with the button control

  1. Private Sub CommandButton1_Click()
  2. Dim i As Integer
  3. Dim j As Long
  4. Dim d As Double
  5. Dim str As String
  6. MsgBox "This is a demo"
  7. End Sub

Now, to see the code associated with the button control, goto Design mode and select the button.

excel vba view code developer tab

excel vba view code developer tab

Now click on the 'View Code' button.

The user will be taken to theVBA editor containing the code related to the control.

excel vba view code developer tab

 

You can find similar Excel Questions and Answer hereunder

1) What is the xml group in the developer tab in Excel

2) How to enable or disable macros execution or loading in Excel

3) Vba code to password protect workbook in Excel

4) I have to enter non alphanumeric characters in a cell using VBA - how can I get their codes for use in VBA?

5) What is the design mode in the developer Tab in Excel

6) How can I prevent users from seeing / accessing my macro code?

7) How can I have text autocomplete by typing in a short code for the text?

8) What are the com addins in the developer tab of Excel

9) What is the use relative references in the Excel Developer Tab

10) What are the addins in the developer tab in Excel

 

Here the previous and next chapter