ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Read EXCEL table (https://www.excelbanter.com/excel-programming/319825-read-excel-table.html)

Roberto Cortiana

Read EXCEL table
 
Hello! I've a problem.
I have an excel sheet thath contains a table made of 16 columns and not
specified number of rows ( for example 10-100-1000 etc.).
My problem is: I want to read this table, using VBA. Now I read each cell,
and when I read an empty value, I assume that there aren't any values to
read.
My question is: Can I read this table in one time ( I've defined the RANGE
object that contains column A:R)?

Thank you for response.
By.



Tom Ogilvy

Read EXCEL table
 
Dim vArr as Variant
Dim rng as Range
set rng = Range("A1").CurrentRegion
set rng = rng.resize(,16)
msgbox rng.address
vArr = rng.Value

for i = 1 to ubound(vArr)
for j = 1 to 16
'use varr(i,j)
Next
Next

--
Regards,
Tom Ogilvy


"Roberto Cortiana" wrote in message
...
Hello! I've a problem.
I have an excel sheet thath contains a table made of 16 columns and not
specified number of rows ( for example 10-100-1000 etc.).
My problem is: I want to read this table, using VBA. Now I read each cell,
and when I read an empty value, I assume that there aren't any values to
read.
My question is: Can I read this table in one time ( I've defined the RANGE
object that contains column A:R)?

Thank you for response.
By.





Roberto Cortiana

Read EXCEL table
 
Thank-you very much!!!!!!!!!!!!!!

IT WORKS CORRECTLY.

"Tom Ogilvy" ha scritto nel messaggio
...
Dim vArr as Variant
Dim rng as Range
set rng = Range("A1").CurrentRegion
set rng = rng.resize(,16)
msgbox rng.address
vArr = rng.Value

for i = 1 to ubound(vArr)
for j = 1 to 16
'use varr(i,j)
Next
Next

--
Regards,
Tom Ogilvy


"Roberto Cortiana" wrote in message
...
Hello! I've a problem.
I have an excel sheet thath contains a table made of 16 columns and not
specified number of rows ( for example 10-100-1000 etc.).
My problem is: I want to read this table, using VBA. Now I read each

cell,
and when I read an empty value, I assume that there aren't any values to
read.
My question is: Can I read this table in one time ( I've defined the

RANGE
object that contains column A:R)?

Thank you for response.
By.








All times are GMT +1. The time now is 02:54 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com