Kenneth, JKwan
Thanks again to both of your for you time and assistance. To summarize the solutions I suppose I can do something like this:
Sub SolutionsDemonstrated()
Dim arrTest1() As String
Dim arrTest2(3, 1)
arrTest1 = Split("A|B|C|D", "|")
arrTest2(0, 0) = "A"
arrTest2(0, 1) = "Apple"
arrTest2(1, 0) = "B"
arrTest2(1, 1) = "Blueberry"
arrTest2(2, 0) = "C"
arrTest2(2, 1) = "Cherry"
arrTest2(3, 0) = "D"
arrTest2(3, 1) = "Dill pickle"
WriteToExcel arrTest1
WriteToExcel arrTest2
End Sub
Sub WriteToExcel(ByVal arrPassed)
Dim o As Object
Set o = CreateObject("excel.application")
With o
.Visible = True
.Workbooks.Add
Select Case fcnNumDemensions(arrPassed)
Case 1
.sheets("sheet1").Range("A1").Resize(UBound(arrPassed) + 1).Value = .Transpose(arrPassed)
Case 2
.sheets("sheet1").Range("A1").Resize(UBound(arrPassed, 1) + 1, UBound(arrPassed, 2) + 1).Value = arrPassed
Case Else
'Do nothing
End Select
End With
End Sub
Function fcnNumDemensions(ByRef arrEvaluate) As Long
Dim lngIndex As Long, lngCheck As Long
On Error GoTo Err_Return
For lngIndex = 1 To 60000 'Limit
'Is error generated? If so demension doesn't exist.
lngCheck = LBound(arrEvaluate, lngIndex)
Next lngIndex
lbl_Exit:
Exit Function
Err_Return:
fcnNumDemensions = lngIndex - 1
Resume lbl_Exit:
End Function