looping through Excel Range

C

Candyman

How do I bring back 6 values from an excel Range? I want to populate an array
and based on that array create multiple reports usingthe excel file.

I have:
Set xlsApp = CreateObject("Excel.Application")
With xlsApp.Application
.Workbooks.Open TemplateFile
.Visible = True
.for each c in range(Rng_LOB)

but it does not like a loop?
 
A

Arvin Meyer [MVP]

Candyman said:
How do I bring back 6 values from an excel Range? I want to populate an
array
and based on that array create multiple reports usingthe excel file.

I have:
Set xlsApp = CreateObject("Excel.Application")
With xlsApp.Application
.Workbooks.Open TemplateFile
.Visible = True
.for each c in range(Rng_LOB)

but it does not like a loop?

It might like it more if you removed it from being an object of the Excel
Application.

For Each c in range(Rng_LOB)
'Do something
Next c
 
C

Candyman

Thanks! That dot me to the point of :
With xlsApp.Application
.Workbooks.Open TemplateFile
'.Visible = True
End With
For Each c In xlsApp.range(Rng_LOB)
myLOBs(i) = c.Value
i = i + 1
Next c

Now I can do my processing.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top