Combobox selection / Delete row after saving in another sheet / Receiving Run-time error '1004': Method 'Range' of object'_Global' failed

Chino21

New Member
Joined
Nov 11, 2011
Messages
30
Hi guys,

Hope you can help me out. I have a form with several textboxes and a combobox.

In sheet1(TWIN SUP), Combobox1 will show the list of names which is in column C. I have a named range(twin2names)

Code:
=OFFSET('TWIN SUP'!$C$1,0,0,COUNTA('TWIN SUP'!$C:$C),1)

This will allow Combobox1 to show new entry.

What Im trying to do is that if I selected a name listed in combobox1 and click save the information that I have entered on the textboxes will be saved in sheet2(TWIN MAN) (This I have no problem). (This part im having trouble with) Once the information has already been saved in sheet2, the row where in the name selected in combobox should be deleted. I tried this code:

Code:
Rows(ActiveCell.Row).Delete

whats happening is that the first row is being delete, the information is being saved in sheet2 then I am receiving an error Run-time error '1004': Method 'Range' of object'_Global' failed. What im trying to do is if for example I have 20 names in column C and I selected the name in the said row, that entire row will be deleted.

Also, is there any other way to populate the names that I have in Column C so that it will show in combobox?

I hope somebody can help me out.
 

Excel Facts

Control Word Wrap
Press Alt+Enter to move to a new row in a cell. Lets you control where the words wrap.
Can you try this:
Code:
Rows(ActiveSheet.DropDowns("Drop Down 2").Value).EntireRow.Delete
Instead of "Drop Down 2" put in the name of your combobox.
 
Upvote 0
Can you try this:
Code:
Rows(ActiveSheet.DropDowns("Drop Down 2").Value).EntireRow.Delete
Instead of "Drop Down 2" put in the name of your combobox.

Hi Patrict,
The code that you have given me gave an error saying Unable to get the DropDowns property of the worksheet class

Code:
Rows(ActiveSheet.DropDowns("cboagent").Value).EntireRow.Delete
 
Upvote 0

Forum statistics

Threads
1,214,588
Messages
6,120,409
Members
448,959
Latest member
camelliaCase

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