View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
NickHK NickHK is offline
external usenet poster
 
Posts: 4,391
Default display in web page format & paging

This version is a bit more stable. As you cannot pass parameters in a call
to .OnTime, use public variables to pass settings:
SHIFT+ESC to halt execution.

'<Standard Module code
Public StartRange As Range
Public NextRange As Range

Public Const HOURS_DELAY As Long = 0
Public Const MINUTES_DELAY As Long = 0
Public Const SECONDS_DELAY As Long = 2

Public Const ROWS_JUMP As Long = 25
Public Const COLUMNS_JUMP As Long = 0

Public mStopLoop As Boolean

Public Sub MyGoToLoop()

With Application
.Goto NextRange, True

If ActiveCell.Row + ROWS_JUMP < ActiveSheet.UsedRange.Rows.Count Then
Set NextRange = ActiveCell.Offset(ROWS_JUMP, COLUMNS_JUMP)
Else
Set NextRange = StartRange
End If

If mStopLoop = False Then
.OnTime Now + TimeSerial(HOURS_DELAY, MINUTES_DELAY, SECONDS_DELAY),
"MyGoToLoop"
Else
.Goto StartRange, True
.OnKey "+{ESC}", ""
End If
End With

End Sub

Public Function StopLoop()
mStopLoop = True
End Function
'</Standard Module code

'<WS Copde
Private Sub CommandButton1_Click()

Set StartRange = Range("A1")
Set NextRange = Range("A1").Offset(ROWS_JUMP, COLUMNS_JUMP)
mStopLoop = False

With Application
.Wait Now + TimeSerial(HOURS_DELAY, MINUTES_DELAY, SECONDS_DELAY)
.OnKey "+{ESC}", "StopLoop"
End With

Call MyGoToLoop

End Sub
'</WS Copde

NickHK

"Grrrrrumpy" wrote in message
...
No code can be seen/ modified, it was pass protected. I think I'm being
confusing. I want to display 28 or so rows of screen1 of a spreadsheet,
pause, page down, display the next 28 rows, pause, page down.. etc. I want
code or a macro to do this. When I reached the bottom, say 25 pages, I

want
to go to the top and start over. If you do a print preview or a web page
preview of a spreadsheet, you will get an idea of what I want to see on

the
screen. I dont want to see the row or column markings on the screen.

"NickHK" wrote:

Can't you just edit the code you have from before, change the 4 to 18.

NickHK

"Grrrrrumpy" wrote in message
...
In an Excel 2003 spreadsheet, I have my layouts in sheet1, my data is

input
for these layouts are inputted from sheet2.
The layouts consist of 28-30 rows (this can be changed to fit on a

screen).
I want to display on the screen the 30 rows of sheet1.
A laptop will be connected to a big screen TV so it can be viewed in a

large
room.
I want to pause a few seconds, page down and display the next 28 or

30
rows, pause, page down...etc.
When I reach the bottom, I want to go to the top and start the display
again. The display should be in "web page format" or "print preview

format".
To stop the process, the user press the ESC key.

This has done before. It displays groups of 4 teams in a round robin

format
that
is updated during the event. The previous code was limited to 72

teams -
18
screens. It needs to be expanded. The macros were pass protected and

are
unaccessible.

How do I do put the worksheet in webpage format and page down thru it?

Thanks
Joe