Hello,
Im trying to obtain the cell address of the value returned by hlookup and then transfer another value to the cell below it. In the code month_match returns a string. I've defined Mat_add as Range. I get [h=1]Application-defined or object-defined error, Office 1004[/h]error code. Wanted to know what is the mistake in my command?
VB:
Month_match = Application.WorksheetFunction.HLookup(Month, Blad1.Range("B8:N9"), 1, False)
Mat_add = Application.WorksheetFunction.Index(ThisWorkbook.ActiveSheet.Range("B9:N9"), Application.WorksheetFunction.Match(Month_match, ThisWorkbook.ActiveSheet.Range("B8:N9"), 0), 1)
Im trying to obtain the cell address of the value returned by hlookup and then transfer another value to the cell below it. In the code month_match returns a string. I've defined Mat_add as Range. I get [h=1]Application-defined or object-defined error, Office 1004[/h]error code. Wanted to know what is the mistake in my command?
VB:
Month_match = Application.WorksheetFunction.HLookup(Month, Blad1.Range("B8:N9"), 1, False)
Mat_add = Application.WorksheetFunction.Index(ThisWorkbook.ActiveSheet.Range("B9:N9"), Application.WorksheetFunction.Match(Month_match, ThisWorkbook.ActiveSheet.Range("B8:N9"), 0), 1)