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: 709
Default Date format converted from UK to US format

I have a workbook with multiple tabs, each of which take data from mutlipe
spreadsheets using a Query. I then use the code below, to consolidate all the
data on the tabs into one table, so i can PivotReport on it. The problem
comes from the columns with dates in it - they import using the Query in UK
format, but after the code has brought the tabs into one, they become US
format as text. Can anyone help correct this, as i'm having to use a
workaround formula to rearrange the cells at the moment.

Sub collate2()
Dim firstRow As Double, lastRow As Double, srcRng As Range, destRng As
Range, ws As Worksheet
firstRow = 2
For Each ws In Sheets
'goes through the workbook grabbing data, if the sheet isn't called
"orders"
With ws
If LCase(.Name) < "analysis" Then
'finds last used row by selecting last row and simulating
ctrl-up arrow
lastRow = .Cells(Rows.Count, "B").End(xlUp).Row
If lastRow = firstRow Then 'makes sure there's some data to
copy
'gets range of data in current sheet
Set srcRng = .Range(.Cells(firstRow, "A"),
..Cells(lastRow, "AL"))
'gets range of first cell on row below data already on
sheet
Set destRng = Sheets("MasterSheet").Cells(Rows.Count,
"B").End(xlUp).Resize(lastRow - firstRow + 1, 40).Offset(1, -1)
destRng.Value = srcRng.Value
End If
End If
End With
Next ws
End Sub
--
Richard
 
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
Need help with converting CUSTOM format/TEXT format to DATE format Deo Cleto Excel Worksheet Functions 6 June 2nd 09 08:14 PM
Issues with Time being converted to Date/Time format D[_10_] Excel Programming 1 February 28th 07 08:32 PM
when loading csv file to Excel, cells get converted to date format RB Excel Discussion (Misc queries) 3 February 14th 07 07:54 AM
How do I create list validation from code without the text being converted into date format? EG[_3_] Excel Programming 2 November 24th 05 10:16 AM


All times are GMT +1. The time now is 06:45 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"