Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Shelley Shepherd via OfficeKB.com
 
Posts: n/a
Default Conditional Macro

I have an Excel workbook which naviagates from sheet to sheet using a
control button to move to the next sheet in the workbook. How can I
program the macro attached to the control button so that if condition X
(False) is met, one moves to sheet A ("Insulin Rate"), but if condition Y
(True) is met, one moves to sheet B ("Prev Gluc 2")? This is what I've
tried thus far:
If ("G1") = False Then
Sheets("Insulin Rate").Activate
Range ("C3").Activate
ElseIf ("G1") = True Then
Sheets("Prev Gluc 2").Activate
Range ("C3").Activate
EndIf

I've also tried using .Select instead of .Activate, but that doesn't work
either. Appreciate your help.

--
Message posted via http://www.officekb.com
  #2   Report Post  
Bob Phillips
 
Posts: n/a
Default

If Range("G1").Value = False Then
Sheets("Insulin Rate").Activate
Range ("C3").Activate
ElseIf Range("G1").Value = True Then
Sheets("Prev Gluc 2").Activate
Range ("C3").Activate
EndIf



--

HTH

RP
(remove nothere from the email address if mailing direct)


"Shelley Shepherd via OfficeKB.com" wrote in message
...
I have an Excel workbook which naviagates from sheet to sheet using a
control button to move to the next sheet in the workbook. How can I
program the macro attached to the control button so that if condition X
(False) is met, one moves to sheet A ("Insulin Rate"), but if condition Y
(True) is met, one moves to sheet B ("Prev Gluc 2")? This is what I've
tried thus far:
If ("G1") = False Then
Sheets("Insulin Rate").Activate
Range ("C3").Activate
ElseIf ("G1") = True Then
Sheets("Prev Gluc 2").Activate
Range ("C3").Activate
EndIf

I've also tried using .Select instead of .Activate, but that doesn't work
either. Appreciate your help.

--
Message posted via http://www.officekb.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
Can't get simple macro to run Abi Excel Worksheet Functions 5 January 12th 05 08:37 PM
Help with macro formula and variable Huge project Excel Worksheet Functions 0 December 28th 04 02:27 AM
Macro and If Statement SATB Excel Discussion (Misc queries) 2 December 3rd 04 05:46 PM
Macro Formula revision? Mark Excel Worksheet Functions 1 November 28th 04 02:43 AM
Macro for multiple charts JS Excel Worksheet Functions 1 November 19th 04 04:44 AM


All times are GMT +1. The time now is 11:34 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"