hi Sparks,
Here is an example, check that the dates are in a valid date format for your xl version.
http://cjoint.com/?AJvuvWGxtt4
Sub Macro1()
For i = 1 To Sheets("sh1").Range("A65536").End(xlUp).Row
If Application.IsText(Sheets("sh1").Range("A" & i)) Then
For y = 2 To 6
With Sheets("sh2")
n = .Range("A65536").End(xlUp).Row + 1
.Range("A" & n + y) = "varname = " & Sheets("sh1").Cells(i, 1)
.Range("A" & n + y + 1) = "date = " & dt
.Range("A" & n + y + 2) = "time = " & Format(Sheets("sh1").Cells(rw, y), "hh:mm:ss")
.Range("A" & n + y + 3) = "value = " & Sheets("sh1").Cells(i, y)
End With
Next
Else
If IsDate(Sheets("sh1").Range("A" & i)) Then
dt = Sheets("sh1").Range("A" & i)
rw = i
End If
End If
Next
End Sub
--
isabelle