Ravindra Bagale · Excelसर्व coursesया course चे lessonsशोधाEnglish

Excel · मराठी आवृत्ती

Excel

12.4 VBA Editor ओळखा

या page मध्ये

Developer › Visual Basic किंवा Windows Alt + F11ने VBE उघडा.

भागShortcut / menuउपयोग
Project ExplorerCtrl + ROpen workbooks, sheets, ThisWorkbook, Modules, Forms.
PropertiesF4Selected objectचं नाव व properties.
Code windowModule double-clickCode लिहिण्याची जागा.
ImmediateCtrl + GDebug.Print output, छोटं expression.
Locals / WatchView menuPaused codeमधल्या values तपासा.

Module तयार करा

  1. Insert › Module. General macros आणि worksheet UDFs standard moduleमध्ये ठेवा.
  2. वर Option Explicit लिहा; variables declare करणं आवश्यक होतं.
  3. Tools › Options › Editor › Require Variable Declarationने नवीन modulesमध्ये हे automatic जोडा. Existing modulesमध्ये स्वतः तपासा.
  4. Module select › F4 › (Name) = modPractice किंवा modReports.
  5. Right-click module › Export/Importने code reuse करता येतो; imported code आधी वाचा.

Immediateमध्ये ?ThisWorkbook.Worksheets.Count, ?ActiveSheet.Name आणि ?ActiveSheet.Range("A1").Value पाहा. Sheet/ThisWorkbook modules eventsसाठी उपयोगी असतात; ते “फक्त एका sheetवर code करू शकतात” एवढाच नियम नाही. General callable UDFसाठी standard module निवडा.

Practice

modPractice तयार करून Option Explicit घाला. Active sheetचं नाव आणि A1ची value Immediateमध्ये print करा.