Skip to main content

Timeline for Reorder columns in Array

Current License: CC BY-SA 3.0

15 events
when toggle format what by license comment
Feb 14, 2018 at 10:19 vote accept QHarr
Feb 13, 2018 at 0:12 history tweeted twitter.com/StackCodeReview/status/963204242046627840
Feb 12, 2018 at 17:35 history edited QHarr CC BY-SA 3.0
corrected transcribe error. If bot spots this as possible answer invalidation please refer to comments. It makes no material difference.
Feb 12, 2018 at 9:38 comment added user109261 I didn't think that you would run into the dd/mm/yyyy issue. You could try using.Range("A1:K2").Value2 and tempArr2(i, 1) = tempArr(i, 9). .Value2 ignores formatting and uses the integer value of the Date. Of course, you will still have to change the Columns format. It would probably be easier to do it your way.
Feb 12, 2018 at 9:19 comment added QHarr @ThomasInzina What I am saying is if during the array to array transition #12/02/2018# has become #02/12/2018# how will formatting the sheet with "yyyy-mm-dd" ensure I will have the original #12/02/2018# back as #02/12/2018# would also be recognised as valid. Apologies if I am being more dense than usual on this.
Feb 12, 2018 at 4:18 answer added Raystafarian timeline score: 1
Feb 12, 2018 at 3:28 history edited Jamal CC BY-SA 3.0
deleted 45 characters in body
Feb 12, 2018 at 1:53 comment added user109261 You should be able to apply the "yyyy-mm-dd" format to the columns regardless of the Excel version Columns("A").NumberFormat = "yyyy-mm-dd".
Feb 10, 2018 at 20:26 answer added paul bica timeline score: 1
Feb 10, 2018 at 20:20 comment added QHarr I am sometimes getting US formats written out to the sheet if I don't do that. I can't format the column after to be UK as it won't always know which should be converted. I would have to assume they are always US and re-arrange the characters in the sheet? A UK format goes into the array, but when transferring between arrays it seems US format kicks in and goes back out to sheet. This doesn't always happen which is weird. Tbh I edited that change in because I suddenly noticed the change. Happy to have advice on how to resolve. It is a pain i usually get around by simply working with strings.
Feb 10, 2018 at 20:13 comment added user109261 You shouldn't convert the date value into a text value. It is better to format the columns after you write the data back to the spreadsheet.
Feb 10, 2018 at 17:30 history edited QHarr CC BY-SA 3.0
Added typed function for preserving UK date format
Feb 10, 2018 at 10:56 history edited QHarr CC BY-SA 3.0
added 93 characters in body
Feb 10, 2018 at 10:21 history edited QHarr CC BY-SA 3.0
forgot to add code!
Feb 10, 2018 at 9:55 history asked QHarr CC BY-SA 3.0