Hi All
I have tried to piece together a solution from numerous threads but have not solved my problem.
I am trying to upload an excel range (non adjacent columns and unkown amount of rows) to an array. Up to now I have used the below which uploads the full sheet and I have manipulated the array before eventually adding it to an access table. The UsedRange has now become to large and I was getting an overflow error.
MyArray = MyWB.Sheets(1).UsedRange
My plan now is to define a range selecting only the columns I need to upload to the access table. Lets say Column A, B, D, G for now.
I have seen some solutions using "Union" to deal with the non adjacent column issue (will this stop at the first empty row?). I have seen people mention LastRow to find the "last row". But I just cant piece it all together.
I have my reference to excel object library and I think I have all the excel variables defined. I am just struggling with setting the variables. Once I get it into an array I should be able to complete the task.
Any help fully appreciated.
Craig
I have tried to piece together a solution from numerous threads but have not solved my problem.
I am trying to upload an excel range (non adjacent columns and unkown amount of rows) to an array. Up to now I have used the below which uploads the full sheet and I have manipulated the array before eventually adding it to an access table. The UsedRange has now become to large and I was getting an overflow error.
MyArray = MyWB.Sheets(1).UsedRange
My plan now is to define a range selecting only the columns I need to upload to the access table. Lets say Column A, B, D, G for now.
I have seen some solutions using "Union" to deal with the non adjacent column issue (will this stop at the first empty row?). I have seen people mention LastRow to find the "last row". But I just cant piece it all together.
I have my reference to excel object library and I think I have all the excel variables defined. I am just struggling with setting the variables. Once I get it into an array I should be able to complete the task.
Any help fully appreciated.
Craig