Getting started with VBA

Chanmingman's Blog

This article is get you started with VBA.

After almost 20 years I have learned VBA, Microsoft never changed Macro to be able to use C# without using Visual Studio. Hence, many people stuck with VBA.

This article will show you how to start VBA in Excel 2013.

1. Start Excel 2013.

2. Go to File Tab -> Options -> Customize Ribbon then enable the Developer tab.

 vba

3. Go to Developer tab choose Insert, under ActiveX choose Command Button.

 vba2

4. Double click the Command Button Excel will bring you to Visual Basic. Type the following code inside the CommandButton1_Click().

Private Sub CommandButton1_Click(

  Worksheets(“Sheet1”).Activate

  Range(“A1”).Value = “1”

End Sub

5. Back to the Excel sheet click the Design Mode to enable to run mode.

Now you can try to click the button.

View original post

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: