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