Free tutorials & notes in Hindi & English · Clean code examples · Mobile friendly learning
NotesInformation Technology (402) › Ch 5: Using Macros
Class X · Unit 2: Electronic Spreadsheet (Advanced) — Calc · Hindi + English

Ch 5: Using Macros

What is a Macro?

Macro: a single instruction that executes a set of instructions — a recorded sequence of commands that can be run any number of times to automate repeated tasks.

Enable: Tools > Options > LibreOffice > Advanced → tick "Enable macro recording". Record: Tools > Macros > Record Macro → do actions → Stop Recording.

Library → Module → Macro: a Library holds Modules; a Module holds Macros. Default macro = "Main", in the Standard library.

Macro in BASIC

Macros are written in BASIC. Code begins with Sub <name> and ends with End Sub. A macro-as-function uses Function … End Function and returns a value.

Naming rules: must begin with a letter, no spaces, no special characters except the underscore (_).

Summary

  • A macro automates repeated tasks; recording must be enabled first.
  • Library > Module > Macro. Code: Sub … End Sub, written in BASIC.
  • The recorder works only in Calc and Writer.

Macro क्या है?

Macro: एक instruction जो कई instructions का set चलाती है — commands का recorded sequence जिसे बार-बार चलाकर दोहराए जाने वाले काम automate किए जाते हैं।

Enable: Tools > Options > LibreOffice > Advanced → "Enable macro recording" tick करें। Record: Tools > Macros > Record Macro → actions करें → Stop Recording।

Library → Module → Macro: Library में Modules, Module में Macros होते हैं। Default macro = "Main", Standard library में।

BASIC में Macro

Macros BASIC में लिखे जाते हैं। Code Sub <name> से शुरू और End Sub पर खत्म। Macro-as-function Function … End Function use करता है और value return करता है।

Naming rules: अक्षर से शुरू, कोई space नहीं, underscore (_) के अलावा कोई special character नहीं।

सारांश

  • Macro दोहराए जाने वाले काम automate करता है; पहले recording enable करें।
  • Library > Module > Macro। Code: Sub … End Sub, BASIC में।
  • Recorder सिर्फ़ Calc और Writer में काम करता है।

Frequently Asked Questions

In which language are LibreOffice macros written?

Macros are written in the BASIC language, beginning with Sub and ending with End Sub.

What are the rules for naming a macro?

A macro name must begin with a letter, contain no spaces, and no special characters except the underscore.