To insert a row or column is generally easy with vba. However, do it automatically in a locked cell according to user input is not easy. My question is How to automatically insert formatted style row or column in a locked Excel sheet saved as xlsm?
Explain:
I have a sheet called "Sheet1" is a locked with password, "ABCD", user can only input the data in the colored area. However, sometimes the list is short, while others are long. Automatically insert row and column is a good idea like data-grid in Visual Studio.
Please see the picture, if user enters anything in row 9 in the colored area, then it automatically create a formatted-style row 10 (for Components List 1). If user enter anything to empty row 14, then it inserts row 15 in Components List 2.
Same thing if user enters anything in column H, then I create column I
I do not know how to write the syntax but here is my thoughts on the design:
I must define a name for area in components List 1 (Com1), Components List 2 (Com2), and the blue area (Part_quality) so the program knows which area if should check for user input
Checking if user input data in defined names range. If yes, check if user enter any data in the last row and last column. If yes, unlock the file with predetermined password stored in memory, insert row/column, then locked it