How to get Excel data in order - without first row

How to get Excel data in order - without first row

m09366023695
Enthusiast Enthusiast
394 Views
3 Replies
Message 1 of 4

How to get Excel data in order - without first row

m09366023695
Enthusiast
Enthusiast

I have an excel like this:

 

excel1.JPG

 

but I want to get all data inside an array without first rows (left to right):

 

excel2.JPG

0 Likes
395 Views
3 Replies
Replies (3)
Message 2 of 4

Ed__Jobe
Mentor
Mentor

Are you saying that you want A1,B1,C1,C2,C3? And not A1,B1,C1,A2,B2,C2,A3,B3,C3? If you want something different, please give us a list.

 

One simple way is to check each cell's Value property and if it equals "" ( an empty string), then don't add it to the array.

Ed


Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.
How to post your code.

EESignature

0 Likes
Message 3 of 4

m09366023695
Enthusiast
Enthusiast

I don't want A1,B1,C1 etc.

I want A2,B2,C2,C3,C4,D2.

0 Likes
Message 4 of 4

Ed__Jobe
Mentor
Mentor

I would create a Range from the selected cells, and then iterate the range to add cells to an array. If you select the cells with your mouse, as you did in the picture, you can right click and select "Define Name". This creates a named range. You can also create a Range object in code.

Ed


Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.
How to post your code.

EESignature

0 Likes