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: 226
Default UK Based data format in ListBoxes

Hi all

I was wondering if someone can give me some advice on UK based dates
in a Listbox. I am running Excel 2003 on XP. My problem is that
Excel reverts back to US date formatting when you load the data from a
sheet into a Listbox.

The method I have been using to transfer the data is by passing the
range to an array and then the array to the Listbox, this is because I
want the code to be available to calls to load data from many
different sheets with varying row and column count for example 194
rows and 19 columns with around 16 of those columns holding a date, I
have included a sample of code at the end of the post to show what I’m
doing.

I have read in this group that one way around it is to store the dates
in the sheet as text rather than a date, I am trying to find away to
solve the problem without having to change the formatting used on the
sheet but if I have no other options that is what I shall do.

Any and all help is much appreciated.

Option Explicit
Dim LastRow As Integer
Dim colCount As Integer
Dim ViewAllArray()
Dim ViewAllRng As Range

Sub SetAndLoadList(MySheet As String)
‘Name of the sheet is passed as an argument
With Sheets(MySheet)

LastRow = [A65535].End(xlUp).Row

colCount = [A1].End(xlToRight).Column

Set ViewAllRng = Range(Cells(1, 1), Cells(LastRow, colCount))

ViewAllArray = ViewAllRng

Me.ListBox1.ColumnCount = colCount

Me.ListBox1.List = ViewAllArray

End With

End Sub

Cheers

Steve
 
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
Synchronize data in two LISTBOXes cellist Excel Discussion (Misc queries) 1 October 12th 09 03:39 PM
Code to import data based on selection in two listboxes Steven Taylor Excel Programming 1 June 22nd 07 07:03 AM
Multi Listboxes with data dependent upon user choices SaturnGolfBoy Excel Programming 2 June 17th 06 01:50 AM
Transferring data between listboxes toocold[_7_] Excel Programming 4 April 3rd 06 06:06 PM
format based on data from another cell Sanna R. New Users to Excel 1 April 19th 05 06:34 PM


All times are GMT +1. The time now is 12:12 AM.

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"