Hi,
I am trying to load a multiple column table into an array.
1) Load table into array
2) Manipulate several of the columns stored in the array with select case
3) Write back array to spreadsheet
I have 1 working but I am not sure how to do #2 and #3?
I am trying to use select case myArray(x,6) to manipulate the information in the array but maybe there is a better way?
Also, is it possible to loop through a table/databodyrange from bottom to top?
I want to do all the calculations on the information in the array and then write the array back to a new sheet.
I am trying to load a multiple column table into an array.
1) Load table into array
2) Manipulate several of the columns stored in the array with select case
3) Write back array to spreadsheet
I have 1 working but I am not sure how to do #2 and #3?
VBA Code:
Sub MultiColumnTable_To_Array()
Dim myTable As ListObject
Dim myArray As Variant
Dim x As Long
Set myTable = ActiveSheet.ListObjects("Table1")
myArray = myTable.DataBodyRange
For x = LBound(myArray) To UBound(myArray)
Debug.Print myArray(x, 3)
Next x
End Sub
I am trying to use select case myArray(x,6) to manipulate the information in the array but maybe there is a better way?
VBA Code:
Select case myArray(x,6)
Case Is = 0
Debug.Print ="Off"
Case Is = 0.5
Debug.Print = "On"
End Select
Also, is it possible to loop through a table/databodyrange from bottom to top?
I want to do all the calculations on the information in the array and then write the array back to a new sheet.