ListView Query

cdchapman

Board Regular
Joined
Dec 30, 2010
Messages
112
Hi,

Not sure if this is possible, but is there any way of inserting a horizontal line between rows of data in a Listview control on a userform?

At present the listview displays data as below:

Title 1 Title 2 Title 3
Data1 Data 2 Data 3
...
...
TOTALS Total 1 Total 2

The totals line is displayed using a different font colour from the rest of the data which is fine, but it would look better if there was a horizontal line separating the totals from the rest of the data, something like:

Title 1 Title 2 Title 3
Data1 Data 2 Data 3
...
...
________________________
TOTALS Total 1 Total 2

I've tried adding the horizontal line using the "_" character in a ListItem, but this has breaks at each column - does anyone know if it is possible to make the line continuous (in effect merging the columns just for that line)?
 

Excel Facts

Fastest way to copy a worksheet?
Hold down the Ctrl key while dragging tab for Sheet1 to the right. Excel will make a copy of the worksheet.

Flammy

Board Regular
Joined
Apr 19, 2011
Messages
51
Maybe add the character to each element?

x = "Title 1" & "|"

then add x to the listview? add spaces and such as needed.
 

cdchapman

Board Regular
Joined
Dec 30, 2010
Messages
112
Thanks for the suggestion Flammy, but this will add a vertical line separating the columns won't it? Also my listview uses a non-proportional font, so I don't think the "|" characters will line up correctly to form a line anyway even with spaces added.

I ideally need an unbroken horizontal line separating the totals from the rest of the data, not a vertical line.
 

Forum statistics

Threads
1,143,661
Messages
5,720,143
Members
422,267
Latest member
olund

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top