View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Alan Beban Alan Beban is offline
external usenet poster
 
Posts: 200
Default Dimention & manipulation of Variant array

Another method of getting a one-dimensional array from a two-dimensional
single row array is

vRow = Application.Index(vRow, 1, 0)

Alan Beban

Tom Ogilvy wrote:
For a single row, you use application.Transpose twice. For a single column,
you use it once:

Sub efg()
Dim vr As Variant, vc As Variant
Dim vRow As Variant, vCol As Variant
Dim rngRow As Range, rngColumn As Range
Set rngRow = Range("A1:Z1")
Set rngCol = Range("A1:A20")
vRow = rngRow.Value
vr = Application.Transpose(Application.Transpose(vRow))
Debug.Print UBound(vr, 1)
vCol = rngCol.Value
vc = Application.Transpose(vCol)
Debug.Print UBound(vc, 1)
End Sub