SlideShare una empresa de Scribd logo
1 de 9
Lesson 1
We all imagine that doing Programming in
Excel, is to add new things to Excel and so it
is some thing not easy to learn.

Interestingly programming Excel is not really
about adding new features as much as it is
about combining existing features to solve
specific problems.
Programming in Excel is to make some task easier
and more reliable.

Through Programming, you are asking Excel to do
certain tasks and Excel Follows that.

Programming languages make things easier
because they are great at performing repetitive
operations and following a logical path without
getting tired or bored. They make things more
reliable because they follow your directions and
never, ever get creative.
The best way to learn Macros and break the
ice is by recording code.

Thru this you can learn about Excel objects,
properties, and methods. We will discuss the
same in detail, in coming slides.

 When we record a macro, we can see that, it
is rather writing a code on its own ( a visual
basic 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 the
below 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 Code
2.   Macros and Security
3.   Classes , Modules and Procedures

Más contenido relacionado

Destacado

Pemrograman makro vba excel 2007
Pemrograman makro vba excel 2007Pemrograman makro vba excel 2007
Pemrograman makro vba excel 2007tm_prasetyo
 
Summer training introduction to matlab
Summer training  introduction to matlabSummer training  introduction to matlab
Summer training introduction to matlabArshit Rai
 
新觀念的VB6教本ch12
新觀念的VB6教本ch12新觀念的VB6教本ch12
新觀念的VB6教本ch12jameschsc
 
E learning excel vba programming lesson 3
E learning excel vba programming  lesson 3E learning excel vba programming  lesson 3
E learning excel vba programming lesson 3Vijay Perepa
 
新觀念的VB6教本ch11
新觀念的VB6教本ch11新觀念的VB6教本ch11
新觀念的VB6教本ch11jameschsc
 
新觀念的VB6教本ch13
新觀念的VB6教本ch13新觀念的VB6教本ch13
新觀念的VB6教本ch13jameschsc
 
新觀念的VB6教本ch04
新觀念的VB6教本ch04新觀念的VB6教本ch04
新觀念的VB6教本ch04jameschsc
 
Modul kuliah-vba-lengkap ok
Modul kuliah-vba-lengkap okModul kuliah-vba-lengkap ok
Modul kuliah-vba-lengkap okAndi Simanjuntak
 
Management productivity tools1
Management productivity tools1Management productivity tools1
Management productivity tools1Hari Krishnan
 
新觀念的VB6教本ch03
新觀念的VB6教本ch03新觀念的VB6教本ch03
新觀念的VB6教本ch03jameschsc
 
新觀念的VB6教本ch02
新觀念的VB6教本ch02新觀念的VB6教本ch02
新觀念的VB6教本ch02jameschsc
 
新觀念的VB6教本ch08
新觀念的VB6教本ch08新觀念的VB6教本ch08
新觀念的VB6教本ch08jameschsc
 
E learning excel vba programming lesson 1
E learning excel vba programming  lesson 1E learning excel vba programming  lesson 1
E learning excel vba programming lesson 1Vijay Perepa
 

Destacado (17)

Pemrograman makro vba excel 2007
Pemrograman makro vba excel 2007Pemrograman makro vba excel 2007
Pemrograman makro vba excel 2007
 
Vba excel
Vba excelVba excel
Vba excel
 
Summer training introduction to matlab
Summer training  introduction to matlabSummer training  introduction to matlab
Summer training introduction to matlab
 
Vba part 1
Vba part 1Vba part 1
Vba part 1
 
新觀念的VB6教本ch12
新觀念的VB6教本ch12新觀念的VB6教本ch12
新觀念的VB6教本ch12
 
E learning excel vba programming lesson 3
E learning excel vba programming  lesson 3E learning excel vba programming  lesson 3
E learning excel vba programming lesson 3
 
新觀念的VB6教本ch11
新觀念的VB6教本ch11新觀念的VB6教本ch11
新觀念的VB6教本ch11
 
新觀念的VB6教本ch13
新觀念的VB6教本ch13新觀念的VB6教本ch13
新觀念的VB6教本ch13
 
新觀念的VB6教本ch04
新觀念的VB6教本ch04新觀念的VB6教本ch04
新觀念的VB6教本ch04
 
AutoCAD Training Syllabus
AutoCAD Training SyllabusAutoCAD Training Syllabus
AutoCAD Training Syllabus
 
Modul kuliah-vba-lengkap ok
Modul kuliah-vba-lengkap okModul kuliah-vba-lengkap ok
Modul kuliah-vba-lengkap ok
 
Management productivity tools1
Management productivity tools1Management productivity tools1
Management productivity tools1
 
新觀念的VB6教本ch03
新觀念的VB6教本ch03新觀念的VB6教本ch03
新觀念的VB6教本ch03
 
新觀念的VB6教本ch02
新觀念的VB6教本ch02新觀念的VB6教本ch02
新觀念的VB6教本ch02
 
新觀念的VB6教本ch08
新觀念的VB6教本ch08新觀念的VB6教本ch08
新觀念的VB6教本ch08
 
Excel VBA
Excel VBAExcel VBA
Excel VBA
 
E learning excel vba programming lesson 1
E learning excel vba programming  lesson 1E learning excel vba programming  lesson 1
E learning excel vba programming lesson 1
 

Último

Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactdawncurless
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfsanyamsingh5019
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)eniolaolutunde
 
Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Celine George
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Educationpboyjonauth
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdfSoniaTolstoy
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfciinovamais
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxiammrhaywood
 
Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfJayanti Pande
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdfQucHHunhnh
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxSayali Powar
 
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...Marc Dusseiller Dusjagr
 
URLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website AppURLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website AppCeline George
 
Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionMastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionSafetyChain Software
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104misteraugie
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introductionMaksud Ahmed
 
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdfssuser54595a
 

Último (20)

Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impact
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdf
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)
 
Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Education
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
 
Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
 
Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdf
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
 
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
 
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdfTataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
 
URLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website AppURLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website App
 
Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionMastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory Inspection
 
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introduction
 
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
 

Excel VBA - Lesson 1 - Basics

  • 2. We all imagine that doing Programming in Excel, is to add new things to Excel and so it is some thing not easy to learn. Interestingly programming Excel is not really about adding new features as much as it is about combining existing features to solve specific problems.
  • 3. Programming in Excel is to make some task easier and more reliable. Through Programming, you are asking Excel to do certain tasks and Excel Follows that. Programming languages make things easier because they are great at performing repetitive operations and following a logical path without getting tired or bored. They make things more reliable because they follow your directions and never, ever get creative.
  • 4. The best way to learn Macros and break the ice is by recording code. Thru this you can learn about Excel objects, properties, and methods. We will discuss the same in detail, in coming slides. When we record a macro, we can see that, it is rather writing a code on its own ( a visual basic code)
  • 5.
  • 6. 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
  • 7. 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
  • 8. The task described in earlier slide ,was recorded in the below 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
  • 9. In the next Lesson – 1. Reading and Understanding Recorded Code 2. Macros and Security 3. Classes , Modules and Procedures