• Save
Excel VBA - Lesson 1 - Basics
Upcoming SlideShare
Loading in...5
×
 

Excel VBA - Lesson 1 - Basics

on

  • 1,467 views

 

Statistics

Views

Total Views
1,467
Slideshare-icon Views on SlideShare
1,467
Embed Views
0

Actions

Likes
1
Downloads
0
Comments
0

0 Embeds 0

No embeds

Accessibility

Categories

Upload Details

Uploaded via as Microsoft PowerPoint

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

    Excel VBA - Lesson 1 - Basics Excel VBA - Lesson 1 - Basics Presentation Transcript

    • Lesson 1
    • We all imagine that doing Programming inExcel, is to add new things to Excel and so itis some thing not easy to learn.Interestingly programming Excel is not reallyabout adding new features as much as it isabout combining existing features to solvespecific problems.
    • Programming in Excel is to make some task easierand more reliable.Through Programming, you are asking Excel to docertain tasks and Excel Follows that.Programming languages make things easierbecause they are great at performing repetitiveoperations and following a logical path withoutgetting tired or bored. They make things morereliable because they follow your directions andnever, ever get creative.
    • The best way to learn Macros and break theice is by recording code.Thru this you can learn about Excel objects,properties, and methods. We will discuss thesame in detail, in coming slides. When we record a macro, we can see that, itis rather writing a code on its own ( a visualbasic code)
    • Let us record a macro with a regular activity Which we repeatedly use on our daily routine. For Example, with a particular Data, I wanted to change the format and convert that into a Graph. Choose Tools - > Macros -> Record New Macro A dialog box appears as shown here ( Record Macro)Select Data Format Option Select Format
    • Select Data Insert Charts Simple Graph Appears While Recording Macro, “Record Macro” Button, becomes a small Blue Square. Once your Recording is over, you need to stop recording as shown below
    • The task described in earlier slide ,was recorded in thebelow Macro Sub Macro1() macro_1 Macro Range("A2:B6").Select ActiveSheet.ListObjects.Add(xlSrcRange, Range("$A$2:$B$6"), , xlYes).Name = _ "Table2" Range("Table2[#All]").Select ActiveSheet.ListObjects("Table2").TableStyle = "TableStyleMedium2" ActiveSheet.Shapes.AddChart.Select ActiveChart.SetSourceData Source:=Range("Sheet1!$A$2:$B$6") ActiveChart.ChartType = xlColumnClustered End Sub
    • In the next Lesson –1. Reading and Understanding Recorded Code2. Macros and Security3. Classes , Modules and Procedures