Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default How to print all columns from a multi column listbox?


Hi all, i have a 4 column listbox on a userform populated like this:


VBA Code:
--------------------


With UserForm1.ListBox1
.AddItem rng.Address
.List(.ListCount - 1, 1) = rng.Offset(0, -29).Value
.List(.ListCount - 1, 2) = rng.Offset(0, -25).Value
.List(.ListCount - 1, 3) = rng.Offset(0, -24).Value
ic = ic + 1
End With
--------------------


i now want to print all 4 columns as seen in the listbox, could
someone explain how?


--
Simon Lloyd

Regards,
Simon Lloyd
'Excel Chat' (http://www.thecodecage.com/forumz/chat.php)
------------------------------------------------------------------------
Simon Lloyd's Profile: 1
View this thread: http://www.thecodecage.com/forumz/sh...d.php?t=191929

http://www.thecodecage.com/forumz

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,549
Default How to print all columns from a multi column listbox?

Add a worksheet, write the list to the worksheet, print the worksheet, delete the worksheet.
--
Jim Cone
Portland, Oregon USA



"Simon Lloyd"
wrote in message ...

Hi all, i have a 4 column listbox on a userform populated like this:
VBA Code:
--------------------
With UserForm1.ListBox1
.AddItem rng.Address
.List(.ListCount - 1, 1) = rng.Offset(0, -29).Value
.List(.ListCount - 1, 2) = rng.Offset(0, -25).Value
.List(.ListCount - 1, 3) = rng.Offset(0, -24).Value
ic = ic + 1
End With
--------------------
i now want to print all 4 columns as seen in the listbox, could
someone explain how?
--
Simon Lloyd

Regards,
Simon Lloyd

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default How to print all columns from a multi column listbox?


Jim, thanks for the reply, i did try as you suggested, however it
either only wrote the first value from the first column or wrote the
value of the selected item but not the corresponding data in the same
row in the other 3 columns.

Could you give an example please on writing the data eg. column 1 to
column A, column 2 to coulmn B...etc


Jim Cone;686899 Wrote:

Add a worksheet, write the list to the worksheet, print the worksheet,
delete the worksheet.
--
Jim Cone
Portland, Oregon USA



"Simon Lloyd"
wrote in message ...

Hi all, i have a 4 column listbox on a userform populated like this:
VBA Code:
--------------------
With UserForm1.ListBox1
.AddItem rng.Address
.List(.ListCount - 1, 1) = rng.Offset(0, -29).Value
.List(.ListCount - 1, 2) = rng.Offset(0, -25).Value
.List(.ListCount - 1, 3) = rng.Offset(0, -24).Value
ic = ic + 1
End With
--------------------
i now want to print all 4 columns as seen in the listbox, could
someone explain how?
--
Simon Lloyd

Regards,
Simon Lloyd


--
Simon Lloyd

Regards,
Simon Lloyd
'Excel Chat' (http://www.thecodecage.com/forumz/chat.php)
------------------------------------------------------------------------
Simon Lloyd's Profile: 1
View this thread: http://www.thecodecage.com/forumz/sh...d.php?t=191929

http://www.thecodecage.com/forumz

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,549
Default How to print all columns from a multi column listbox?

Simon,

In the form module...
Worksheets("Sludge").Range("B2").Resize(ListBox1.L istCount - 1, ListBox1.ColumnCount).Value = ListBox1.List
--
Jim Cone
Portland, Oregon USA
(Special Sort... http://www.contextures.com/excel-sort-addin.html
30+ additional ways to sort)



"Simon Lloyd"
wrote in message ...
Jim, thanks for the reply, i did try as you suggested, however it
either only wrote the first value from the first column or wrote the
value of the selected item but not the corresponding data in the same
row in the other 3 columns.

Could you give an example please on writing the data eg. column 1 to
column A, column 2 to coulmn B...etc




Jim Cone;686899 Wrote:

Add a worksheet, write the list to the worksheet, print the worksheet,
delete the worksheet.
--
Jim Cone
Portland, Oregon USA



"Simon Lloyd"
wrote in message ...
Hi all, i have a 4 column listbox on a userform populated like this:
VBA Code:
--------------------
With UserForm1.ListBox1
AddItem rng.Address
List(.ListCount - 1, 1) = rng.Offset(0, -29).Value
List(.ListCount - 1, 2) = rng.Offset(0, -25).Value
List(.ListCount - 1, 3) = rng.Offset(0, -24).Value
ic = ic + 1
End With
--------------------
i now want to print all 4 columns as seen in the listbox, could
someone explain how?
--
Simon Lloyd

Regards,
Simon Lloyd


--
Simon Lloyd

Regards,
Simon Lloyd
'Excel Chat' (http://www.thecodecage.com/forumz/chat.php)
------------------------------------------------------------------------
Simon Lloyd's Profile: 1
View this thread: http://www.thecodecage.com/forumz/sh...d.php?t=191929

http://www.thecodecage.com/forumz

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default How to print all columns from a multi column listbox?


Thanks Jim worked a treat, i had previously tried something similar:
Sheets("PrintBox").Range("A1").Resize(ic, 4) = UserForm1.ListBox1

Where ic was an iteration count as items were added top the list but it
didn't perform, thanks for clearing that up!


Jim Cone;687240 Wrote:

Simon,

In the form module...
Worksheets("Sludge").Range("B2").Resize(ListBox1.L istCount - 1,
ListBox1.ColumnCount).Value = ListBox1.List
--
Jim Cone
Portland, Oregon USA
(Special Sort... 'Excel Sort Addin'
(http://www.contextures.com/excel-sort-addin.html)
30+ additional ways to sort)



"Simon Lloyd"
wrote in message ...
Jim, thanks for the reply, i did try as you suggested, however it
either only wrote the first value from the first column or wrote the
value of the selected item but not the corresponding data in the same
row in the other 3 columns.

Could you give an example please on writing the data eg. column 1 to
column A, column 2 to coulmn B...etc




Jim Cone;686899 Wrote:

Add a worksheet, write the list to the worksheet, print the worksheet,
delete the worksheet.
--
Jim Cone
Portland, Oregon USA



"Simon Lloyd"
wrote in message ...
Hi all, i have a 4 column listbox on a userform populated like this:
VBA Code:
--------------------
With UserForm1.ListBox1
AddItem rng.Address
List(.ListCount - 1, 1) = rng.Offset(0, -29).Value
List(.ListCount - 1, 2) = rng.Offset(0, -25).Value
List(.ListCount - 1, 3) = rng.Offset(0, -24).Value
ic = ic + 1
End With
--------------------
i now want to print all 4 columns as seen in the listbox, could
someone explain how?
--
Simon Lloyd

Regards,
Simon Lloyd


--
Simon Lloyd

Regards,
Simon Lloyd
'Excel Chat' (http://www.thecodecage.com/forumz/chat.php)
------------------------------------------------------------------------
Simon Lloyd's Profile: 1
View this thread: 'How to print all columns from a multi column
listbox? - The Code Cage Forums'
(http://www.thecodecage.com/forumz/sh...d.php?t=191929)

'Microsoft Office Help - Microsoft Office Discussion - Excel VBA
Programming - Access Programming' (http://www.thecodecage.com/forumz)


--
Simon Lloyd

Regards,
Simon Lloyd
'Excel Chat' (http://www.thecodecage.com/forumz/chat.php)
------------------------------------------------------------------------
Simon Lloyd's Profile: 1
View this thread: http://www.thecodecage.com/forumz/sh...d.php?t=191929

http://www.thecodecage.com/forumz

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
Multi Column Listbox Help Ken Excel Programming 0 December 20th 06 10:23 PM
Multi Column UserForm ListBox Mik Excel Programming 1 May 4th 06 10:10 PM
(repost) Listbox Rowsource Headings Multi columns hgdev Excel Programming 1 April 13th 04 07:08 PM
Multi-column ListBox. Multiple bound columns??? Joe Mathis Excel Programming 5 December 10th 03 01:32 AM
Multi-columns in a ListBox Tom Atkisson Excel Programming 1 October 5th 03 10:27 PM


All times are GMT +1. The time now is 10:12 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"