View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
Bob Phillips[_6_] Bob Phillips[_6_] is offline
external usenet poster
 
Posts: 11,272
Default If/Then help in returning value

Try again,

If you avoid selecting, but address the range directly, the fact that the
sheet is hidden is immaterial. For instance,

With Worksheets("Sheet2").Range("A5")
If .Value = 1 Then
box1.show
ElseIf ... etc
End If
End With

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"Big Chris " wrote in message
...
I've treked through the Excel Tips and search time and again through the
history on here but can't find anything that answers my query.....and
I'm pretty new to all this!

Please can anyone help?

I am basically trying to write a macro that says....

If Sheet2, CellA5 =1 then run box1.show
If Sheet2, CellA5 =2 then run box2.show
If Sheet3, CellA5 =3 then run box3.show

Trouble is Sheet2 is very hidden and protected so I can't go to the
cell and say 'If activecell' etc.....well I suppose I can but it
involves unhiding it and it contains the guts of my application. Is
there any easy way?

Any ideas please?

Many thanks,


---
Message posted from http://www.ExcelForum.com/