Hi,
I have no idea how to print all value appears on the listbox .I tried some code but failed.
Thanks in advance
herukuncahyono
Hi,
I have no idea how to print all value appears on the listbox .I tried some code but failed.
Thanks in advance
herukuncahyono
Last edited by herukuncahyono; 04-12-2010 at 08:52 PM.
I don't really understand what you are trying to do.
click on the * Add Reputation if this was useful or entertaining.
You would need to write the list box values to a range of cells and print from the worksheet.
However, since you are using Case Statements to fill the list box, why not just set the print area to that range of cells and print as needed? You could, if necessary, copy the cells to another worksheet.
This is, by far the easiest way to go about it as the code would be very minimal.
Palmetto
Do you know . . . ?
You can leave feedback and add to the reputation of all who contributed a helpful response to your solution by clicking the star icon located at the left in one of their post in this thread.
hi Palmetto,
thanks for the reply ,I almost get a solution on the internet(code to print listbox) but the problem is, there are only 1 column was printed ( I attach an example ) I want all data in listbox is printed,
thanks in advance
herukuncahyono
In order to print each column of the list box you must reference each column, like so:
For i = 1 To nTotalLines Me.ListBox1.ListIndex = i - 1 Cells(i, 1).Value = Me.ListBox1.Column(0) Cells(i, 2).Value = Me.ListBox1.Column(1) Cells(i, 3).Value = Me.ListBox1.Column(2) Cells(i, 4).Value = Me.ListBox1.Column(3) Cells(i, 5).Value = Me.ListBox1.Column(4) Next
hi Palmetto,
great fit with my expectations,my problem solved
thank you I really appreciate it
herukuncahyono
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks