none
Adding 2 command buttons to a row when data is added from a Userform RRS feed

  • Question

  • Good Morning All

    I have a worksheet which has rows of data. Each row pertains to an individual project. The data in these rows is read only and is added from an "Add Data" Userform. When the "Add" Userform Command button is pressed, the data from the "Add Data" Userform is added to the next empty row on worksheet1 from Column B to Column T. I am now trying to do 3 things. 

    1. When this data is added, I would also like 2 command buttons adding to Column A in the same row as the rest of this new data, one command button is "Edit" and the other "Delete".

    2.  These newly added buttons only effect the data on the row they currently occupy and therefore when edit is pressed the "Edit" Userform opens populated with the data from this row. This I think I have cracked.

    3. When Delete is pressed a "Data about to be deleted" warning appears  and then when Ok is selected that whole row is deleted and any data with command buttons below the deleted row move up.

    Thanks

    Steve

    Friday, May 3, 2019 8:01 AM

Answers

  • To Stirlingmw,

    Haven't heard back from you since my reply. Have you resolved your problem?


    Regards, OssieMac

    • Marked as answer by Stirlingmw Sunday, May 12, 2019 8:29 PM
    Sunday, May 12, 2019 5:30 AM

All replies

  • Do you want the buttons to remain on the row indefinitely which means you could have an enormous number of buttons or are they only required temporarily?

    You indicate both buttons to be in column A. Am I correct in assuming that you will have column A set fairly wide to accommodate the buttons?

    Will there be any data in column A under the buttons?

    If it is your intention to retain the buttons indefinitely then I suggest a different method being that you use both column A and B for the Edit and Delete and in lieu of the buttons, you enter Edit and Delete in the cells and then double click the cell to start the required code. Do you see this as a viable alternative solution?

    There are problems with controls (buttons) added to a worksheet. They have a tendency to move and resize under some conditions (setting "Don't Move or Size" does not alleviate this problem). If the button moves sufficiently to have the top left corner out of the row then identifying the row to which the button is assigned becomes a problem.

    I'll await your reply before attempting to resolve the situation for you.


    Regards, OssieMac

    Monday, May 6, 2019 9:22 PM
  • To Stirlingmw,

    Haven't heard back from you since my reply. Have you resolved your problem?


    Regards, OssieMac

    • Marked as answer by Stirlingmw Sunday, May 12, 2019 8:29 PM
    Sunday, May 12, 2019 5:30 AM
  • OssieMac

    I do apologies, I was sent back to sea for a little while (Royal Navy). My boss has now changed his mind with his requirement, so I no longer require an answer to this problem. I will however know doubt be back in touch for help.

    Apologies again

    Steve

    Sunday, May 12, 2019 8:29 PM
  • That's OK. However, have a look at the Microsoft Community site at the link below where you should find that you will get answers much more promptly. This MSDN site is more aimed at Professional Developers.

    Select Office and follow the prompts. Select Office Icon -> Select the Office Topic and Sub Topic from DropDowns -> Then Office Product from DropDown.

    Select "Ask a question" (At very top).

    After completing the question, ensure that you fill in the fields at the bottom. They are self explanatory but ensures that your question is correctly positioned in the forum.

    https://answers.microsoft.com/en-us/


    Regards, OssieMac

    Sunday, May 12, 2019 9:31 PM