I need help figuring out the end of an excel spreadsheet that I am opening through vb. I open it as:
Dim wkbOjb As Object
Set fs = CreateObject("Scripting.FileSystemObject"
Set f = fs.GetFolder("C:\test\cust"
Set fc = f.Files
i = 1
For Each f1 In fc
Set wkbobj = GetObject("C:\test\cust\" & f1.Name)
a = wkbobj.Worksheets(1).Range("A" & i + 1).Value
b = wkbobj.Worksheets(1).Range("B" & i + 1).Value
c = wkbobj.Worksheets(1).Range("C" & i + 1).Value
Next f1
I would like to increment i to get all the values in the spreadsheet but do not know how to stop at the end. Please help. Thanks.
Dim wkbOjb As Object
Set fs = CreateObject("Scripting.FileSystemObject"
Set f = fs.GetFolder("C:\test\cust"
Set fc = f.Files
i = 1
For Each f1 In fc
Set wkbobj = GetObject("C:\test\cust\" & f1.Name)
a = wkbobj.Worksheets(1).Range("A" & i + 1).Value
b = wkbobj.Worksheets(1).Range("B" & i + 1).Value
c = wkbobj.Worksheets(1).Range("C" & i + 1).Value
Next f1
I would like to increment i to get all the values in the spreadsheet but do not know how to stop at the end. Please help. Thanks.