Hello,
I have a database in a range on Personal.xlsb workbook, in Sheet1. I would like to retreive the data from the other columns, using VBA.
I have this code. It works only while Personal.xlsb is activated. While I activate other workbook, I'm getting an error message (application defined or object defined error).
1. How to solve this issue?
2. Additional question: I would like to lookup the data in this range. For example, I would like to search for 'mrr factor' (row 7) using VBA. If found, to retreive the rest of the columns related to this row. How to do this? Note that Peronal.xlsb workbook is hidden.
Thanks,
Uriel
I have a database in a range on Personal.xlsb workbook, in Sheet1. I would like to retreive the data from the other columns, using VBA.
I have this code. It works only while Personal.xlsb is activated. While I activate other workbook, I'm getting an error message (application defined or object defined error).
1. How to solve this issue?
2. Additional question: I would like to lookup the data in this range. For example, I would like to search for 'mrr factor' (row 7) using VBA. If found, to retreive the rest of the columns related to this row. How to do this? Note that Peronal.xlsb workbook is hidden.
Thanks,
Uriel
VBA Code:
Sub VBALookup()
Dim dRng As Range
Set dRng = Workbooks("personal.xlsb").Worksheets("sheet1").Range("A2", [A2].End(xlDown))
Set wsCopy = Workbooks("personal.xlsb").Worksheets("sheet1").Range("A2", [A2].End(xlDown))
Dim cel As Range
For Each cel In wsCopy.Cells
pol = cel.Offset(0, 4).Value
Next cel
End Sub