View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Jim Thomlinson Jim Thomlinson is offline
external usenet poster
 
Posts: 5,939
Default Integrating data into VB code

A couple of things... Change your int to Long... That number is too large...
then

Dim code As Long

code = Worksheets("HOME").Range("C4").Value
Sheets(Format(code, "0")).Visible = True

--
HTH...

Jim Thomlinson


"Mark Warner" wrote:

I need a bit of help, obviously. I want to retrieve a data value from a cell
which is the NAME of a worksheet. I want to integrate that retrieved value
into the VB code to either HIDE or UNHIDE the sheet. I have this:

Dim code As Integer
code = Worksheets("HOME").Range("C4").Value '(which equals 160628)'

I want to take that value of 160628 and get it into this type of code
replacing the "HOME" section:
Sheets("HOME").Visible = True
Thanks.