Super Suarez
Registered User.
- Local time
- Today, 14:03
- Joined
- Jul 10, 2013
- Messages
- 36
Hi Guys,
How do I search an excel spreadheet (temp.xlsx) for a given variable (customer.value)? The variable will be in say field I. Once I find it then I've got to pull that rows data out.
I've managed to open an excel sheet and pick a cell and return customer data by the following, but I can't work out the search part. Not sure if I should be looking at select statements or vlookup or anything else. Here's how far I've got
On Error Resume Next
Set ExcelApp = GetObject(, "Excel.Application")
If Err.Number <> 0 Then
Err.Clear
Set ExcelApp = CreateObject("Excel.Application")
End If
ExcelApp.Workbooks.Open (folder)
With ExcelApp
' Make Excel invisible through the Application object
.Application.Visible = False
'Insert Excel Data into variable
Customer = .Worksheets(1).Range("D7").Value
UseratEnd = .Worksheets(1).Range("I8").Value
Customer.Value = Customer
CustomerEnd.Value = UseratEnd
[date raised].Value = Date
ExcelApp.Workbooks.Open ("temp.xlsx")
..........
.Application.Quit
End With
Hope someone can help
How do I search an excel spreadheet (temp.xlsx) for a given variable (customer.value)? The variable will be in say field I. Once I find it then I've got to pull that rows data out.
I've managed to open an excel sheet and pick a cell and return customer data by the following, but I can't work out the search part. Not sure if I should be looking at select statements or vlookup or anything else. Here's how far I've got
On Error Resume Next
Set ExcelApp = GetObject(, "Excel.Application")
If Err.Number <> 0 Then
Err.Clear
Set ExcelApp = CreateObject("Excel.Application")
End If
ExcelApp.Workbooks.Open (folder)
With ExcelApp
' Make Excel invisible through the Application object
.Application.Visible = False
'Insert Excel Data into variable
Customer = .Worksheets(1).Range("D7").Value
UseratEnd = .Worksheets(1).Range("I8").Value
Customer.Value = Customer
CustomerEnd.Value = UseratEnd
[date raised].Value = Date
ExcelApp.Workbooks.Open ("temp.xlsx")
..........
.Application.Quit
End With
Hope someone can help