View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
agarwaldvk[_38_] agarwaldvk[_38_] is offline
external usenet poster
 
Posts: 1
Default Sheet number variable


Dear Mike

I presume this is what you are after - not sure though!

If the cell contains a number, then your variable can be made to rea
the value contained in that cell and then activate the workshee
corresponding to the relevant worksheet as follows :-

if the cell address is A1 then

shCount = cells(1,1).value
worksheets(shCount).activate

This should work (after you have put these lines of code in a Sub
presuming that there are at least as many worksheets in your workshee
as the value entered in the referred cell, in this case cell A1

Hopefully, this helps!

If not, please let me know!


Best regards


Deepak Agarwa

--
agarwaldv
-----------------------------------------------------------------------
agarwaldvk's Profile: http://www.excelforum.com/member.php...fo&userid=1134
View this thread: http://www.excelforum.com/showthread.php?threadid=27008