Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Is this code in a UDF? If not, it is unlikely that
Application.Caller.Parent.Parent will work. Try this nmodules = ThisWorkbook.Sheets("Sheet1").Range("NSETS").Value if everything is in the same workbook or even nmodules = ActiveWorkbook.Sheets("Sheet1").Range("NSETS").Val ue if you will use it on other workbooks, activating it before -- HTH RP (remove nothere from the email address if mailing direct) "shishi" wrote in message oups.com... Hi, I have 2 sheets in a work book. In Sheet1 I have something like Number of sets = 27. This number (27) falls into the D7 of sheet1. I have defined a name NSETS to this cell with this kind of expression =Sheet1!$D$7. But now I need to use this number in the vba code I have for the Sheet2. In Sheet2 I have the code like this Set WBook = Application.Caller.Parent.Parent nmodules = WBook.Sheets("Sheet1").Range("NSETS").Value But this is not working. What I am I doing wrong? Thanks shi |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Hyperlink varaible substitution - How To | Excel Worksheet Functions | |||
Use varaible for worsheet name in a formule | Excel Programming | |||
Assining the value of a vlookup to a cell rather than the vlookup | Excel Programming | |||
Disappearance of assigned value of varaible when working with form | Excel Programming | |||
Passing a named varaible to Excel's Autofilter | Excel Programming |