16
Moderator
#1
Function getfromexcel()
Dim i As Integer
Dim j As Integer

Dim excelfil As String
excelfile = "D:\CAA DEMO\Excel Worksheet.xlsx"

Dim objExcel As New Excel.Application
Dim worksheetName As String
Dim exWb As Excel.Workbook
Set exWb = objExcel.Workbooks.Open(excelfile)
For i = 1 To 1000
If exWb.Sheets("Sheet1").Cells(i, 1) <> "" Then
i = i + 1
total = i
End If
Next

For i = 1 To total
A(i) = exWb.Sheets("Sheet1").Cells(i, 1)
B(i) = exWb.Sheets("Sheet1").Cells(i, 2)
Next
exWb.Close
Set exWb = Nothing
objExcel.Quit
End Function
Reply



Forum Jump:


Users browsing this thread:
1 Guest(s)