Edit/Delete Button and ComboBox in sheets

SirTertle

New Member
Joined
Jan 25, 2022
Messages
15
Office Version
  1. 365
Platform
  1. Windows
Hello All,

I'm creating an application using VBA to practice my skills, but I'm stuck on a couple of parts. One of them I think would be easier for a more regular user as I know I've seen the instructions on how to do it, but I can't find it anymore.

The first thing I'm wanting to do is have a button for edit and a button for delete and when a cell is chosen I want to either edit that row or delete it. I can't quiet find the code to make this work.

The second thing is, when a user creates a new entry that get's added to the form, is there a way to make some of those cells a ComboBox so I can quickly change it's status or priority?

Thanks!
 

Excel Facts

Excel motto
Not everything I do at work revolves around Excel. Only the fun parts.
Are you using ActiveX controls, or Forms controls?

Deleting is easy, once you answer the question above.

What do you mean by "edit"?

When you say "the form" do you mean you have formatted a worksheet so you can use it as a form?

when a user creates a new entry that get's added to the form, is there a way to make some of those cells a ComboBox
You need to provide a lot more detail about what you are doing. How does the user create a new entry? Where does the data for that new entry go? What do you mean "some of those cells"?
 
Upvote 0
Are you using ActiveX controls, or Forms controls?

Deleting is easy, once you answer the question above.

What do you mean by "edit"?

When you say "the form" do you mean you have formatted a worksheet so you can use it as a form?


You need to provide a lot more detail about what you are doing. How does the user create a new entry? Where does the data for that new entry go? What do you mean "some of those cells"?
These are some very fine questions kind sir! I'm VERY new to VBA (1 month) so I'm not really to sure how to know if I'm using ActiveX or form controls. Sorry about that. I'm taking a very big guess here and saying form controls.

I've created a userform that enters the inputs onto a sheet (basically a To Do list).

Then it gets added to the sheet

1643815802286.png


When I click the edit button, I would like the selected row to repopulate the userform for modification.

For the Priority and Status, I would like those to be a ComboBox so I can quickly change those without having to edit the whole line.

I hope that clarifies things a little better!
 
Upvote 0
What is the "edit" button?
it's a button I'm creating to open a userfrom with the selected row based on which task is being chosen and will be auto filled with that information of the row to be edited and updated on the form
 
Upvote 0
Sorry, what thing in your image is the "Edit" button? There is no button with the word "Edit."
 
Upvote 0
OK, got it.

What do you want to happen when the user clicks that?
 
Upvote 0
OK, got it.

What do you want to happen when the user clicks that?
well the user would select the task that they want to edit then click the edit button. A userform will pop up with the information from that line to be edited. then when you click ok/save the information will be updated on that line! I realize that this is a small amount of information and would probably just be easier to just click it and update it, but I'm doing it to become familiar with how VBA works
 
Upvote 0
OK your question is much bigger than what I thought. You need someone to tell you how to create a userform, add all the controls, load the data from the worksheet, edit it, and save the data when you are done. I know how to do all of that but I don't have the time to prepare a tutorial on it. That is much more than I bargained for and I will step aside to hope someone else looks in who has a bit more time to contribute.
 
Upvote 0

Forum statistics

Threads
1,214,789
Messages
6,121,605
Members
449,038
Latest member
Arbind kumar

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top