Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,624
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default 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   Report Post  
Posted to microsoft.public.excel.programming
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/



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
returning a sum value kyoko Excel Discussion (Misc queries) 2 September 15th 09 08:47 AM
Returning the value Returning the value Excel Discussion (Misc queries) 2 June 13th 09 07:59 AM
UDF from Add-In returning #NAME ryan Excel Worksheet Functions 0 March 5th 08 08:35 PM
UDF returning #VALUE! why? Adam Kroger Excel Discussion (Misc queries) 7 December 18th 05 09:43 PM
=if returning 0 Jim Excel Worksheet Functions 4 December 15th 05 07:09 PM


All times are GMT +1. The time now is 12:17 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"