Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Loop macro for a Newbie
I would like to be able to move to a specific page in my
spreadsheet when a condition is met. I need this to work in one of my existing macros. ie When cell(15,8)=0 go to Sheets("view").Select otherwise ActiveSheet.Calculate Loop back. How can one write a simple loop program? Thanks and Happy new year. Mike |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Loop macro for a Newbie
try
Sub gothereif() If Cells(15,8) =0 Then Application.Goto Sheets("view").Range("a1") End Sub -- Don Guillett SalesAid Software "mike" wrote in message ... I would like to be able to move to a specific page in my spreadsheet when a condition is met. I need this to work in one of my existing macros. ie When cell(15,8)=0 go to Sheets("view").Select otherwise ActiveSheet.Calculate Loop back. How can one write a simple loop program? Thanks and Happy new year. Mike |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Loop macro for a Newbie
sub WaitforAValue()
If Activesheet.Name = "Sheet1" then do if ActiveSheet.Cells(15,8) = 0 then Worksheets("View").Activate exit sub Else ActiveSheet.Calculate end if DoEvents Loop while true End If End Sub if cells(15,8) is a formula that calculate a floating point number, then it may never equal zero. You would need a test like if Abs(Activesheet.Cells(15,8).Value) < .0001 then I assume there is something in your worksheet that would cause the value of cells(15,8) to change on a calculate. -- Regards, Tom Ogilvy -- Regards, Tom Ogilvy "mike" wrote in message ... I would like to be able to move to a specific page in my spreadsheet when a condition is met. I need this to work in one of my existing macros. ie When cell(15,8)=0 go to Sheets("view").Select otherwise ActiveSheet.Calculate Loop back. How can one write a simple loop program? Thanks and Happy new year. Mike |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Loop macro for a Newbie
thanks. that works great
-----Original Message----- sub WaitforAValue() If Activesheet.Name = "Sheet1" then do if ActiveSheet.Cells(15,8) = 0 then Worksheets("View").Activate exit sub Else ActiveSheet.Calculate end if DoEvents Loop while true End If End Sub if cells(15,8) is a formula that calculate a floating point number, then it may never equal zero. You would need a test like if Abs(Activesheet.Cells(15,8).Value) < .0001 then I assume there is something in your worksheet that would cause the value of cells(15,8) to change on a calculate. -- Regards, Tom Ogilvy -- Regards, Tom Ogilvy "mike" wrote in message ... I would like to be able to move to a specific page in my spreadsheet when a condition is met. I need this to work in one of my existing macros. ie When cell(15,8)=0 go to Sheets("view").Select otherwise ActiveSheet.Calculate Loop back. How can one write a simple loop program? Thanks and Happy new year. Mike . |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
VBA Newbie: Help with Do Loop code | Excel Discussion (Misc queries) | |||
Macro Help for Newbie | Excel Programming | |||
newbie: stop a FOR NEXT loop | Excel Programming | |||
Newbie. Please help me find a loop solution | Excel Programming | |||
Newbie. Please help me find a loop solution | Excel Programming |