Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 542
Default Automatically remove a Combo Box

I am trying to find out how to automatically remove a combo box after it is
created. This process needs to be repeatable. i.e. use one combo box response
to generate a new combo box, then remove the new combo box after the message
box that pops up from the second box actions have been acknowledged. Then be
able to repeate the process.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Automatically remove a Combo Box

An ActiveX combobox is both an OleObject and a Shape
Activesheet.OleObject("Combobox1").Delete
Activesheet.Shapes("Combobox2").Delete

A combobox from the forms toolbar is both a shape and an dropdown
Activesheet.Shapes("Drop Down 1").Delete
ActiveSheet.DropDowns("Drop Down 1").Delete

A dropdown from data validation using the list option
ActiveCell.Validation.Delete
ActiveCell.offset(1,0).Select

--
Regards,
Tom Ogilvy



"James" wrote in message
...
I am trying to find out how to automatically remove a combo box after it

is
created. This process needs to be repeatable. i.e. use one combo box

response
to generate a new combo box, then remove the new combo box after the

message
box that pops up from the second box actions have been acknowledged. Then

be
able to repeate the process.



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 542
Default Automatically remove a Combo Box

The Combo Box is from the forms Toolbar. Each time the first combo box
creates a new second Combo box, it is given an increasing number. So if I
hardcode a number into the VBA code, it only works one time then the next
time the second Combo box is created, it has a new number.

James

"Tom Ogilvy" wrote:

An ActiveX combobox is both an OleObject and a Shape
Activesheet.OleObject("Combobox1").Delete
Activesheet.Shapes("Combobox2").Delete

A combobox from the forms toolbar is both a shape and an dropdown
Activesheet.Shapes("Drop Down 1").Delete
ActiveSheet.DropDowns("Drop Down 1").Delete

A dropdown from data validation using the list option
ActiveCell.Validation.Delete
ActiveCell.offset(1,0).Select

--
Regards,
Tom Ogilvy



"James" wrote in message
...
I am trying to find out how to automatically remove a combo box after it

is
created. This process needs to be repeatable. i.e. use one combo box

response
to generate a new combo box, then remove the new combo box after the

message
box that pops up from the second box actions have been acknowledged. Then

be
able to repeate the process.




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 542
Default Automatically remove a Combo Box

I figured out how to name the combo box when it was being created so I could
use the same referance to delete it. Thank you Tom for the code to delete
DropDown .

James

"Tom Ogilvy" wrote:

An ActiveX combobox is both an OleObject and a Shape
Activesheet.OleObject("Combobox1").Delete
Activesheet.Shapes("Combobox2").Delete

A combobox from the forms toolbar is both a shape and an dropdown
Activesheet.Shapes("Drop Down 1").Delete
ActiveSheet.DropDowns("Drop Down 1").Delete

A dropdown from data validation using the list option
ActiveCell.Validation.Delete
ActiveCell.offset(1,0).Select

--
Regards,
Tom Ogilvy



"James" wrote in message
...
I am trying to find out how to automatically remove a combo box after it

is
created. This process needs to be repeatable. i.e. use one combo box

response
to generate a new combo box, then remove the new combo box after the

message
box that pops up from the second box actions have been acknowledged. Then

be
able to repeate the process.




Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
remove text that pops up with combo box Jeff Excel Worksheet Functions 1 September 21st 05 02:36 AM
How can I automatically remove duplicate data within a column? MECG Excel Discussion (Misc queries) 1 June 1st 05 12:22 AM
How do I automatically remove carriage returns in Excel? Mike O. Excel Discussion (Misc queries) 4 February 18th 05 11:24 PM
Run a MACRO automatically by selecting value from combo box KrazyRed Excel Programming 1 December 18th 04 12:17 PM
Automatically remove &[Date] s3cardi Excel Programming 0 August 12th 03 01:13 PM


All times are GMT +1. The time now is 02:29 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"