0

If I create a new sheet in a workbook via macro, is there a way to automatically also include a code for worksheet_change event on that sheet.?

I am creating sheet with name "Group A" in a workbook via macro.

There a cells that have to change to uppercase once the user enters values into it.

How can i achieve this?

  • https://stackoverflow.com/questions/34837006/excel-vba-add-code-to-sheet-module-programmatically – Jos Woolley Feb 07 '22 at 06:07
  • See this page for the sub worksheet_change https://learn.microsoft.com/fr-fr/office/vba/api/excel.worksheet.change and this one for workbook addedSheet https://learn.microsoft.com/en-us/office/vba/api/excel.workbook.newsheet –  Feb 07 '22 at 06:10
  • 2
    Create a hidden sheet containing your code. Use that as a template when you create a new sheet – chris neilsen Feb 07 '22 at 06:46
  • Why don't you use the Workbook_SheetChange event in the ThisWorkBook module? – EvR Feb 07 '22 at 12:45
  • I used the workbook_sheetchange event and got it done. Thanks all. – Ajoy Lawrence Feb 09 '22 at 05:54

0 Answers0