Macros

  • Thread starter Thread starter Harami
  • Start date Start date
Hi

A Macro is defined as a stored procedure. It is basically a list of instructions, or lines of code, that can be run repetitively - in other words a little programme inside a bigger one

You can use them in Word, Excel, Access, etc. Maybe the easiest way to learn to write and use one is in Excel. Open a blank workbook. Make cell A1 your actve cell. Click on TOOLS>MACROS> RECORD NEW MACRO. Call the Macro "my style", and click OK. A tiny floating toolbar appears - leave it open. You are now "recording" - Excel will keep track of all your actions so that it can repeat them later. Click on the formatting buttons for BOLD, ITALICS, CENTER, and FONTCOLOR RED. On the little toolbar click on the STOP RECORDING button (the square). Now undo the formatting you performed earlier - BOLD,ITALICS etc

Type your name in A1. Click on TOOLS>MACRO>MACROS. Click on your "my style" macro, and then click the RUN button. It will apply the formats to the contents of that cell (it will ONLY work in that cell....) So you have recorded a set of actions, and now you can repeat them at will

That is obviously very simple, but you can quickly work on it from there...

Good luck!
Davi
www.stylus.co.za
 
A macro is a set of one or more actions that each perform a
particular operation, such as opening a form or printing a
report. Macros can help you to automate common tasks. For
example, you can run a macro that prints a report when a
user clicks a command button.

See Access help "Macro" for further info

Jim
 
NOTE: "Macro" means multiple things in the Microsoft Office/Access world.

In *general*, a macro is a named (name picked by you) set of instructions
that can be executed whenever you need it. It saves you the trouble of
executing all the independent instructions for you. This can save lots and
lots of time.

Some "macros" are created by turning on an application's "recorder" (MS
Word, MS Excel), clicking away through various menus options, etc., and then
stopping the application's recorder. Most everything done will be
"replayable". The "instruction" list so created is stored as computer
programming code in the VBA (Visual Basic for Applications) language. It is
possible to open up a Visual Basic interface where this VBA computer code
can be read and modified (if you take the trouble to learn it) by hand.

Some "macros" are written entirely by hand from the get-go, directly in
the Visual Basic interface.

Sometime in the early history of MS Access, the application had a separate
feature called "Macros". It was a highly specialized and structured system
of allowing the MS Access programmer to execute, you guessed it, stored
lists of instructions. This early system of MS Access "Macros" is
completely different from VBA. Confusingly enough, Microsoft added VBA into
MS Access (it was actually a very good thing for them to do this, but it's
still somewhat confusing). So now MS Access has two different "Macro"
systems. Microsoft discourages the use of the old Macro system, and in
theory, some future release of MS Access will not support it.

VBA is usually accessible through the Tools menu in most MS Office
applications under Tools>Macro>Visual Basic Editor.

MS Access old-style Macros can be found by using the menu View>Database
Objects>Macros. If you want a new Macro, just click the little "New" icon
with a stylized scroll next to it in the upper right-hand corner of the
Database Window.

Note: MS Access, unlike MS Word and MS Excel, does not have a "recorder"
feature. You can write your own VBA code in the Visual Basic Editor if you
know VBA, DAO, and some other cute acronyms, but there is no recorder (at
least not in Access 2000, I don't know about later versions).
 
Back
Top