I'm having trouble retreiving the value from a named cell on another sheet in the same workbook in VB.
ex:
Workbook name = "Test"
Sheet1 has cell named "INV"
Sheet2 has a macro that needs to retreive the value from the named cell in Sheet1.
** here is the line of code
n_Amount = Workbooks("Test").Worksheets("Sheet1").Cells(Range("[Test]Sheet1!INV").Row, Range("[Test]Sheet1!INV").Column)
** here is the error message I'm getting
run time error '1004' method 'range of object _worksheet' failed
I'm thinking this means it can't find the thing I'm indicating? I don't know why? Similar code works for other value calls?
My question is twofold
1) Why would this line be throwing this error?
2) Is there a better way in VB to retreive a value from a named cell on another sheet??
Thanks in advance for any help.
ex:
Workbook name = "Test"
Sheet1 has cell named "INV"
Sheet2 has a macro that needs to retreive the value from the named cell in Sheet1.
** here is the line of code
n_Amount = Workbooks("Test").Worksheets("Sheet1").Cells(Range("[Test]Sheet1!INV").Row, Range("[Test]Sheet1!INV").Column)
** here is the error message I'm getting
run time error '1004' method 'range of object _worksheet' failed
I'm thinking this means it can't find the thing I'm indicating? I don't know why? Similar code works for other value calls?
My question is twofold
1) Why would this line be throwing this error?
2) Is there a better way in VB to retreive a value from a named cell on another sheet??
Thanks in advance for any help.