Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
What does this do?
Rnum is the index for a loop structure
MROW is the number the user entered in the inputbox plus 10. So if the user entered 1130, it is the number 1140. so this repeats a set of coding statements MROW times. On each increment, rnum is incremented by 1. In this case, the first time rnum equal 1, the second interation, it equals 2 and so forth until it equals MROW when it loops the final time an continues on with the remainder of the code (after the Next statement). for rnum = 1 to Mrow ' do some action on each row if rnum mod 2 = 0 then rows(rnum).Interior.ColorIndex = 4 end if Next the above colors each even row green as an example. -- Regards, Tom Ogilvy "RH" wrote in message ... I'm working on an Excel project and ran across this code snippet: ########################### temp = InputBox(prompt:="Enter the Number of the last row shown on the screen (i.e. 1130):", _ Title:="Length of File", Default:="2000") If temp = "" Then MsgBox prompt:="Convert Data Procedure Canceled." Range("a1").Select Exit Sub Else End If Columns("A:A").Select Selection.Delete Shift:=xlToLeft MRow = CSng(temp + 10) 'Converts temp from string to number counter1 = 0 For Rnum = 1 To MRow ############################## So, in this case....What is RNUM? I don't understand the "= 1 TO MROW" here. Can someone elaborate please? Thanks! Bob |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|