Check the UsedRange property of the Worksheet object. And, you don't
have to go through every cell one at a time. The following transfers
the complete worksheet into a 2D matrix in the variant x.
Sub testIt()
Dim x
x = ActiveSheet.UsedRange.Value
End Sub
--
Regards,
Tushar Mehta
www.tushar-mehta.com
Excel, PowerPoint, and VBA add-ins, tutorials
Custom MS Office productivity solutions
In article ,
says...
Hi.
I want to read all sheet from excel to my program. As i understand, i can
use cell(i,j), but for this i need number of rows and columns, how can i get
it?