Delete data in userforms

Johnwayne

Board Regular
Joined
Sep 6, 2005
Messages
103
how do i delete my data in userforms?
ihave a combobox and few textbox.
once i select an item in my combobox in userforms and click on the delete button, my data will erase..how do i do that?
 

Excel Facts

Best way to learn Power Query?
Read M is for (Data) Monkey book by Ken Puls and Miguel Escobar. It is the complete guide to Power Query.
explaination

I have an userform, when I choose my item in combobox1 in userform, my texbox1 will return me a value, lets say “20. now I want to delete the entry by clicking a button using combobox1 to select the row that I want to delete?

2) is to delete the data by selecting my item in combobox1
 
Upvote 0
But where do you want to delete from?

A worksheet?

From the combobox? ie remove the item from the list
 
Upvote 0
erase from the spreadsheet

erase from the spreadsheet...
meaning i will use my combobox in userform to control it...
once i select the item to be deleted in the spreadsheet using combobox in userform, i will click the delete button, then the item show in spreadsheet willbe deleted...

in my combobox, rowsource is link to my spread sheet...
please advise
 
Upvote 0
Depending on how you've populated the combobox ie what range you've used you could try something like this.
Code:
Private Sub CommandButton1_Click()
    Rows(ComboBox1.ListIndex + 1).Delete
End Sub
 
Upvote 0
cant work!

ok, let me explain further..
I have 4 columns in my spreadsheet. First column will be “date” (column A), second column will be “fruits” (column B), third column will be “amount” (column C) and the fourth column will be “total amount”.
Im using my userform to key in data. I group these under “fruitsA” (define/name). Now I want to know how to delete and edit my data.
In order to delete my data, I need to select the date thru combobox in a userform. Once I selected my data in the userform, my textbox 1,2,3 which contain fruits, amount and total amount will appear. What I want is, when I choose (for example: date 12 July 2006) and click the button delete. My spread sheet under column A that has the same date will be deleted together with the same row.

How do I do that?
Besides this, if I want to edit my data, once I click on combobox, my date will appear and all I want to do is, edit the figures maybe column C (from “20” to “30”) and save it to the spreadsheet my replacing the old date information.. I cant seems to do that too. I did something like tat, but it did not overwrite my old spread sheet… please advise as im new in userforms applications…
 
Upvote 0

Forum statistics

Threads
1,213,527
Messages
6,114,148
Members
448,552
Latest member
WORKINGWITHNOLEADER

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