ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   What does this do? (https://www.excelbanter.com/excel-programming/275431-re-what-does-do.html)

Leo Heuser[_2_]

What does this do?
 
RNUM is a loop variable in the
For - Next struct.

If MRow e.g. is 5, then

RNUM will take the values 1 through 5
as the For-Next-loop loops.

Counter=1
For RNUM=1 to MRow
Counter=Counter+RNUM
Next RNUM

After looping, Counter wil have the value 16

--
Best Regards
Leo Heuser
MVP Excel

Followup to newsgroup only please.

"RH" skrev i en meddelelse
...
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





All times are GMT +1. The time now is 01:10 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com