Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 15
Default Loop through values in a combobox

Hi,

I have a spreadsheet which has a combobox and a table of data below it. When
a value in the combobox is selected, the data below changes. I would like to
write a routine that basically selects each value in the combobox and then
prints the page.

So, something like:

For Each <variable in <Combobox
ActiveWorkbook.PrintOut From:=1, To:=1, Copies:=1, Collate:=True
Next <variable

Is this possible?
If the combo box has 100 items, do I run the risk of crashing the PC, or
printer?
Is there a better way?

Rael
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,593
Default Loop through values in a combobox

Presumably the combobox is sourced from some other data? You could always
loop through that data.

--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"rael_lucid" wrote in message
...
Hi,

I have a spreadsheet which has a combobox and a table of data below it.

When
a value in the combobox is selected, the data below changes. I would like

to
write a routine that basically selects each value in the combobox and then
prints the page.

So, something like:

For Each <variable in <Combobox
ActiveWorkbook.PrintOut From:=1, To:=1, Copies:=1, Collate:=True
Next <variable

Is this possible?
If the combo box has 100 items, do I run the risk of crashing the PC, or
printer?
Is there a better way?

Rael



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 15
Default Loop through values in a combobox

Bob,

Have converted the Combobox to a Listbox and used the following code:

Dim iCount As Long

With Me.lstCentres
For iCount = 0 To .ListCount - 1
.Selected(iCount) = True
If iCount 0 Then .Selected(iCount - 1) = False
Application.DisplayAlerts = False
ActiveWorkbook.PrintOut From:=1, To:=2, Copies:=1, Collate:=True
Application.DisplayAlerts = True
Next iCount
End With

"Bob Phillips" wrote:

Presumably the combobox is sourced from some other data? You could always
loop through that data.

--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"rael_lucid" wrote in message
...
Hi,

I have a spreadsheet which has a combobox and a table of data below it.

When
a value in the combobox is selected, the data below changes. I would like

to
write a routine that basically selects each value in the combobox and then
prints the page.

So, something like:

For Each <variable in <Combobox
ActiveWorkbook.PrintOut From:=1, To:=1, Copies:=1, Collate:=True
Next <variable

Is this possible?
If the combo box has 100 items, do I run the risk of crashing the PC, or
printer?
Is there a better way?

Rael




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
Adding items to ComboBox in a loop? cmpcwil2[_15_] Excel Programming 3 May 4th 06 10:31 AM
Fill values into a listbox matching selected values from a combobox Jon[_19_] Excel Programming 4 January 25th 05 04:25 PM
Click event on combobox in a loop smace[_2_] Excel Programming 0 September 20th 04 04:47 PM
Click event on combobox in a loop smace Excel Programming 1 September 20th 04 04:29 PM
loop through Combobox akyhne Excel Programming 2 May 25th 04 02:34 PM


All times are GMT +1. The time now is 11:14 AM.

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"