Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
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/ |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
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/ |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
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/ |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
returning a sum value | Excel Discussion (Misc queries) | |||
Returning the value | Excel Discussion (Misc queries) | |||
UDF from Add-In returning #NAME | Excel Worksheet Functions | |||
UDF returning #VALUE! why? | Excel Discussion (Misc queries) | |||
=if returning 0 | Excel Worksheet Functions |