Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Problems with Combobox


Hi

My problem is when i try to cut and paste a combobox from one sheet t
another.

The thing is that i first update the combobox by the addItem function
then i cut the combobox and paste it in another worksheet. But when
paste it all the added items are lost. I have also tried to copy th
combobox to another worksheet, and everything seems fine with th
original combobox containing all the added items. This is the cod
sequence:

"an addItem loop adding the elements" then
ComboBox1.Cut
Workbooks("The workbook").Sheets("The sheet").Activate
ActiveSheet.Range("The Range").Select
ActiveSheet.Paste

What seems a bit strange to me, is when I manually with th
ListFillRange in properties add items to the combobox and cut/paste th
combobox everything goes just fine.

All help, is good hel

--
MBai
-----------------------------------------------------------------------
MBais's Profile: http://www.excelforum.com/member.php...fo&userid=2547
View this thread: http://www.excelforum.com/showthread.php?threadid=38980

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Problems with Combobox

You need to copy the code as well. Take a look at
www.cpearson.com/excel/vbe.htm

--

HTH

RP
(remove nothere from the email address if mailing direct)


"MBais" wrote in
message ...

Hi

My problem is when i try to cut and paste a combobox from one sheet to
another.

The thing is that i first update the combobox by the addItem function,
then i cut the combobox and paste it in another worksheet. But when i
paste it all the added items are lost. I have also tried to copy the
combobox to another worksheet, and everything seems fine with the
original combobox containing all the added items. This is the code
sequence:

"an addItem loop adding the elements" then
ComboBox1.Cut
Workbooks("The workbook").Sheets("The sheet").Activate
ActiveSheet.Range("The Range").Select
ActiveSheet.Paste

What seems a bit strange to me, is when I manually with the
ListFillRange in properties add items to the combobox and cut/paste the
combobox everything goes just fine.

All help, is good help


--
MBais
------------------------------------------------------------------------
MBais's Profile:

http://www.excelforum.com/member.php...o&userid=25476
View this thread: http://www.excelforum.com/showthread...hreadid=389800



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Problems with Combobox


Well, it might work to copy all code to another sheet. But in this case
it's not a very good idea im afraid. My program has become quite
complex. But if someone knows how to call a code sequence only once
when a combobox is selected, i think the problem will be solved. I've
tried subs as Combobox1_Click and
Combobox1_GotFocus, but they're called every single time the combobox
is "used".


--
MBais
------------------------------------------------------------------------
MBais's Profile: http://www.excelforum.com/member.php...o&userid=25476
View this thread: http://www.excelforum.com/showthread...hreadid=389800

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 129
Default Problems with Combobox

Hi,

i don't know how to copy items added by AddItem with a combobox
at a time. but i suppose the following can copy items,

Dim varList As Variant
varList = ComboBox1.List
ComboBox1.Cut
Workbooks("The workbook").Sheets("The sheet").Activate
ActiveSheet.Range("The Range").Select
ActiveSheet.Paste
Selection.Object.List = varList

when i copy a combobox, the added items are lost always
whether by macro or manual operation. and they are not saved
in a workbook file. (Excel2000)

--
HTH,

okaizawa


MBais wrote:
Hi

My problem is when i try to cut and paste a combobox from one sheet to
another.

The thing is that i first update the combobox by the addItem function,
then i cut the combobox and paste it in another worksheet. But when i
paste it all the added items are lost. I have also tried to copy the
combobox to another worksheet, and everything seems fine with the
original combobox containing all the added items. This is the code
sequence:

"an addItem loop adding the elements" then
ComboBox1.Cut
Workbooks("The workbook").Sheets("The sheet").Activate
ActiveSheet.Range("The Range").Select
ActiveSheet.Paste

What seems a bit strange to me, is when I manually with the
ListFillRange in properties add items to the combobox and cut/paste the
combobox everything goes just fine.

All help, is good help


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
ComboBox Problems Darrin Henry[_2_] Excel Programming 1 April 15th 05 10:07 PM
ComboBox problems !! Jako[_24_] Excel Programming 4 June 21st 04 04:52 AM
Having problems with adding input from combobox stevem[_5_] Excel Programming 1 April 2nd 04 03:44 AM
Combobox Visibility Problems anthonyvassallo Excel Programming 1 November 7th 03 03:30 PM
ComboBox Problems Darrin Henry Excel Programming 1 September 16th 03 01:23 AM


All times are GMT +1. The time now is 07:04 PM.

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

About Us

"It's about Microsoft Excel"