LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 18
Default Date formatting in a multi column listbox

I am struggling to find a method to display dates correctly in a
listbox. I populate the listbox with the following code.

Private Sub testlist()
Dim rng As Range
Dim cw
Dim colcnt As Integer
Dim rowcnt As Integer

colcnt = ActiveSheet.UsedRange.Columns.Count
rowcnt = ActiveSheet.UsedRange.Rows.Count
str = "a2:g" & rowcnt
Set rng = Range(str)
With ListBox1
.ColumnCount = colcnt
.ColumnHeads = True
.RowSource = rng.Address
cw = ""
For i = 1 To .ColumnCount
cw = cw & rng.Columns(i).Width & ";"
Next
.ColumnWidths = cw
.ListIndex = 0
End With
End Sub

The problem is that column g on the worksheet contains dates and these
are being displayed as values in the listbox. The format I want to
used is "DD/MM/YYYY". Any help will be greatly appriciated.

Nigel Brown
Theisen Securities.
 
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
How to find a value with multi-column, multi-record list Dallasm Excel Worksheet Functions 1 May 30th 10 05:40 PM
Multi-column conditional formatting learningdba Excel Discussion (Misc queries) 2 October 1st 08 04:37 AM
Multi-field listbox in an Excel form Lee S. Excel Discussion (Misc queries) 0 September 14th 06 10:19 PM
match in multi-column and multi-row array sloth Excel Discussion (Misc queries) 14 September 1st 06 10:33 PM
Formatting Listbox Hardy03 Excel Discussion (Misc queries) 0 August 4th 05 12:43 PM


All times are GMT +1. The time now is 02:09 PM.

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"