Hello,
I need help to change the below code so that it shows 2 columns of data in the listbox as opposed to just 1 which is what it does currently. Can anyone help?
Please Login or Register to view this content.
Hello,
I need help to change the below code so that it shows 2 columns of data in the listbox as opposed to just 1 which is what it does currently. Can anyone help?
Please Login or Register to view this content.
Please attach a sample excel sheet if you have..
Regards
Parth
I appreciate your feedback. Hit * if u Like.
Rules - http://www.excelforum.com/forum-rule...rum-rules.html
The first thing you need to do is change the ColumnCount property of the listbox to 2.
You'll then have 2 columns in the listbox, but we would need more information to help you populate them.
If posting code please use code tags, see here.
Sorry that was the code for the wrong userform! The userform I am talking about is less complicated I think
Code is below. I have changed the ColumnCount to 2, the data that needs to go in there is simply from a table column
Please Login or Register to view this content.
Which column does the data for the second column in the listbox come from?
It's in the same PivotTable. The second column in the same Pivot Table
Anyone got any ideas on this please?
You don't refer to a pivot table in the posted code so it's kind of hard to work out how to refer to the second column of a pivot table.
Last edited by Norie; 02-09-2015 at 09:28 AM.
No sorry the pivot table column has been made into a named range, which is the dd_codes that the code refers to. There might have been an easier way to do it.
If the named range 'dd_codes' refers to the first column of the pivot table and you want to show the first two columns in the listbox this might work.
Please Login or Register to view this content.
OK is that to replace any code or just to add onto the end?
It replaces this code.
Please Login or Register to view this content.
Thanks, just tried that and it says invalid use of property?
What exactly did you try?
Please Login or Register to view this content.
Oops, should be this.
Please Login or Register to view this content.
It'snot justPlease Login or Register to view this content.
Please Login or Register to view this content.
Remember what the dormouse said
Feed your head
Excellent, that has sorted it.
Many thanks both of you.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks