View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
shishi shishi is offline
external usenet poster
 
Posts: 33
Default assining a varaible to the value in another sheet.

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