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

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

17.7 Macros आणि VBA — interview answers

रवींद्र बागले यांच्या course वर आधारित · सहज मराठीत explanation

या page मध्ये

प्रत्येक उत्तर समजून घ्या, मग स्वतःच्या exampleने सांगा. Technical terms Englishमध्ये ठेवले आहेत.

Q55. Macro म्हणजे?

Repeat tasks automate करणारे recorded/written VBA instructions. साध्या workbookसाठी .xlsm save; .xlsb/.xlamही code ठेवू शकतात.

Q56. Recorder विरुद्ध writing?

Recorder supported actionsचा सुरुवातीचा code देतो, पण fixed ranges/Selection जास्त असू शकतात. Written codeने variables, conditions, loops, validation आणि error handling. “कोणत्याही sizeचा data”ची guarantee नाही; ranges/memory तपासावी.

Q57. Macro absolute/relative?

Absolute recording fixed cell addresses वापरतो; relative ActiveCellपासून offsets. Worksheet qualifier नसल्यास fixed addressही wrong active sheetवर लागू होऊ शकतो.

Q58. Last row?

lastRow=ws.Cells(ws.Rows.Count,"A").End(xlUp).Row. Reliable populated key column आणि no-data guard. Table.ListRows.Count हा row count आहे, absolute last worksheet row नाही.

Q59. Sub विरुद्ध Function?

Sub actions करतो; Function value returns. Standard moduleची appropriate Public Function worksheet UDF होऊ शकते. Worksheet-called UDFने इतर cells format/edit करण्याचा प्रयत्न नको.

Q60. VBA errors?

On Error GoTo handler; Err.Number/Description आणि common cleanup. बदललेल्या Application settingsची original values restore. Narrow Resume Next वापरल्यास Err तपासून main handler पुन्हा लागू करा.

Q61. Debug कसं?

Option Explicit, Compile, F8 step, F9 breakpoints, Locals/Watch, Debug.Print Immediate. Small known sample आणि expected valuesशी तुलना.

Q62. दुसऱ्याच्या computerवर macro नाही चालला तर?

Macro policy, unsupported platform, .xlsxमध्ये code हरवला, missing path/sheet/reference किंवा PERSONAL dependency तपासेन. Trust Center protection globally बंद करणार नाही; authorised trusted-code workflow वापरेन.