ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   If/Then help in returning value (https://www.excelbanter.com/excel-programming/292204-if-then-help-returning-value.html)

Big Chris[_34_]

If/Then help in returning value
 
I've treked through the Excel Tips and search time and again through th
history on here but can't find anything that answers my query.....an
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 th
cell and say 'If activecell' etc.....well I suppose I can but i
involves unhiding it and it contains the guts of my application. I
there any easy way?

Any ideas please?

Many thanks

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


JE McGimpsey

If/Then help in returning value
 
one way:

If Worksheets("Sheet2").Range("A5").Value = 1 Then Box1.Show


Or

Select Case Worksheets("Sheet2").Range("A5").Value
Case 1
Box1.Show
Case 2
Box2.Show
Case 3
Box3.Show
Case Else
End Select


In article ,
Big Chris wrote:

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/


Bob Phillips[_6_]

If/Then help in returning value
 
Chris,



--

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/




Bob Phillips[_6_]

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/





All times are GMT +1. The time now is 05:53 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com