• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

How to add a new worksheet while adding a new row in the table with macro?

Dima

New Member
Dear all,
The short description of the problem is that I want to have an ability to create a new sheet automatically while adding a new row in existing table. The next requirements should be complied with:
- the new sheet must contain the proforma with a scheme (there is such sheet in the file attached);
- the data of a new worksheet must be applied only for the newly added line in the table;
- the new worksheet must be named by the data taken exactly from the newly added row.

Till now I cannot resolve only the problem how to make so, that the formula in the column D is to be different for every row and not copied from the above one.
Please, see the file attached with comments inside.
Thanks beforehand!
 

Attachments

  • Book3_with macro (ctrl+l).xlsm
    92.8 KB · Views: 6
@Dima
Questions:
Should Summary![A5] be date? Now, it only looks like date (it's a text).
Should 'new sheet' have same layout like '12.12.2015 Andrew'?
>> 24* FALSE/TRUE?
>> two rows numbers with some colors?
>> 24 * CheckBox with formula somewhere?
What kind of action/message, if user tries to make a double name sheet?
What kind of ActiveX contents do You use?
 
@vletm, thanks a lot, please, find the answers below:

@Dima
Questions:
Should Summary![A5] be date? Now, it only looks like date (it's a text). - yes please turn it to the date format (forgot to do so).
Should 'new sheet' have same layout like '12.12.2015 Andrew'? - yes, it should be typical
>> 24* FALSE/TRUE? - please, clarify what do you mean under 24*?
>> two rows numbers with some colors? - there is a conditional formatting for the cells with numbers and the color is changed to yellow as a respective tick-box is selected.
>> 24 * CheckBox with formula somewhere? - yes, there is a massive in the worksheet '12.12.2015 Andrew' A1:p3 with 'TRUE/FALSE' as dependents and the value influence on the filling color of the numbers.
What kind of action/message, if user tries to make a double name sheet? - there can be an error message "Please, check input info!"
What kind of ActiveX contents do You use?
- Checkbox only. You can also add a Command Button named "New Order" in the sheet 'Summary' to activate the whole procedure (adding a row, then creating a new sheet, renaming it, etc.).

Thank you beforehand!
 
@Dima
You answered only to ONE question!
I cannot continue before I'll know ALL answers.

Sorry, but I answered for the questions - just posted it in "unfriendly way" because I'm not familiar with the forum.
Here are the answers once more:
Questions:
Should Summary![A5] be date? Now, it only looks like date (it's a text). -yes please turn it to the date format (forgot to do so).
Should 'new sheet' have same layout like '12.12.2015 Andrew'? - yes, it should be typical
>> 24* FALSE/TRUE? - please, clarify what do you mean under 24*?
>> two rows numbers with some colors? - there is a conditional formatting for the cells with numbers and the color is changed to yellow as a respective tick-box is selected.
>> 24 * CheckBox with formula somewhere? - yes, there is a massive in the worksheet '12.12.2015 Andrew' [A1: P3] with 'TRUE/FALSE' as dependents and the value influence on the filling color of the numbers.
What kind of action/message, if user tries to make a double name sheet? -there can be an error message "Please, check input info!"
What kind of ActiveX contents do You use?
- Checkbox only. You can also add a Command Button named "New Order" in the sheet 'Summary' to activate the whole procedure (adding a row, then creating a new sheet, renaming it, etc.).
 
@Dima - for testing ...
Q: 24* FALSE/TRUE - A: ranges[A2: P3] has those values

There're two new buttons
[ADD ROW] adds new row
[ADD SHEET] adds new sheet after date & doctor values are valid; checks active row's values
'tmp'-sheet = default sheet, which will copy
> I don't use ActiveX contents, so test those too.
Test and send ideas ...
 

Attachments

  • Book3_with macro (ctrl+l).xlsb
    70.8 KB · Views: 2
@vletm
Hi!
Sorry for late respond. I've looked through the file and the buttons to add row and sheet are OK and work correctly.
But I have several remarks:
1) could you please do so that the excel file would not be a binary file?
2) the Check Box is not working any more - please, fix it; as a result the correlation between the Check Boxes an the lines above the number schemes (TRUE/FLSE) is broken - please fix.

These are the core issues. Please try to fix them and I think there will be nothing to do more.

Thank you beforehand!
 
@Dima
1) Why .xlsm? xlsb works sameway ... You have both now.
2) As I told, I don't use ActiveX-contents. So, I gotta use 'mine' Control Box!
I update ONLY to 'tmp'-sheet. Test it,
and if You want to use Your ... You gotta do it Yourself.
 

Attachments

  • Book3_with macro (ctrl+l).xlsm
    87.9 KB · Views: 1
  • Book3_with macro (ctrl+l).xlsb
    71.7 KB · Views: 0
Back
Top