I think the compatibility fix for IE11 might have worked, so let's give it a go.
I'm trying to convert a spreadsheet of weather station observations into a format that will work with WindRose3 (Enviroware). The program does what it says on the tin - rather well, actually.
The conversions are really quite simple, as can be seen by this code, which works properly and I think is self explanatory:
Rowcount = Cells(1048576, 2).End(xlUp).Row
For Count = 2 To Rowcount
Cells(Count, 4) = Cells(Count, 4) * 0.44704
Cells(Count, 6) = Cells(Count, 6) * 0.44704
Cells(Count, 5) = Application.WorksheetFunction.VLookup(Cells(Count, 5), Worksheets("Wind").Range("B4:C24"), 2)
Cells(Count, 7) = Application.WorksheetFunction.VLookup(Cells(Count, 7), Worksheets("Wind").Range("B4:C24"), 2)
Cells(Count, 1) = Format(Cells(Count, 2), "dd/mm/yyyy") & " " & Format(Cells(Count, 3), "hh:mm")
Next
Column 2 contains observation dates in format "dd/mm/yyyy" format.
But as an exercise I'd like convert this to range handling rather than cell by cell manipulation, if only because that is so much faster.
I've got most of this converted nicely:
Code:
Dim rngData As Range
Set rngData = Range(Cells(2, 4), Cells(Rowcount, 4))
rngData = Evaluate(rngData.Address & "*0.44704")
rngData.NumberFormat = "0.00"
Set rngData = Range(Cells(2, 6), Cells(Rowcount, 6))
rngData = Evaluate(rngData.Address & "*0.44704")
rngData.NumberFormat = "0.00"
Set rngData = Range(Cells(2, 5), Cells(Rowcount, 5))
rngData = Application.WorksheetFunction.VLookup(rngData, Worksheets("Wind").Range("B4:C21"), 2, False)
Set rngData = Range(Cells(2, 7), Cells(Rowcount, 7))
rngData = Application.WorksheetFunction.VLookup(rngData, Worksheets("Wind").Range("B4:C21"), 2, False)
But how do you convert the concatenation line to work properly?
Code:
Range("A2:A" & Rowcount).Value = Evaluate("=B2:B" & Rowcount & "&""""&" & "C2:C" & Rowcount)
Gives dates that are far in the future
Code:
Range("A2:A" & Rowcount).Formula = "=B2 & C2"
Gives apparent Julian based numbers which have obviously converted the date section using "mm/dd/yyyy" format.
So how/can you make this conversion using Range handling?