gmaxey
09-30-2019, 02:52 PM
Guys,
Sometimes I can eek out an Excel problem but others I am just a noob.
I have a simple 1 dimensional array. I need to populate the values "across" the row (not down the rows in a single column)
Sub ScratchMacro()
'A basic Word macro coded by Greg Maxey
Dim arr(3) As String
arr(0) = "A"
arr(1) = "B"
arr(2) = "C"
arr(3) = "D"
Sheet1.Range("A1").Resize(UBound(arr) - LBound(arr) + 1).Value = WorksheetFunction.Transpose(arr)
lbl_Exit:
Exit Sub
End Sub
With transpose, the data is right but down column A in four rows. Without transpose it still goes down column A in four rows with "A" in each row
How can I get "A" in A1, "B" in B1, "C" in C1 and so on.
Note this is just an example. My array needs to be one dimensional.
Thanks
Sometimes I can eek out an Excel problem but others I am just a noob.
I have a simple 1 dimensional array. I need to populate the values "across" the row (not down the rows in a single column)
Sub ScratchMacro()
'A basic Word macro coded by Greg Maxey
Dim arr(3) As String
arr(0) = "A"
arr(1) = "B"
arr(2) = "C"
arr(3) = "D"
Sheet1.Range("A1").Resize(UBound(arr) - LBound(arr) + 1).Value = WorksheetFunction.Transpose(arr)
lbl_Exit:
Exit Sub
End Sub
With transpose, the data is right but down column A in four rows. Without transpose it still goes down column A in four rows with "A" in each row
How can I get "A" in A1, "B" in B1, "C" in C1 and so on.
Note this is just an example. My array needs to be one dimensional.
Thanks