Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 620
Default What does this do?

RH,

RNum is simply a variable used as a counter in the For ... Next loop. First
time through the loop it will be set to 1, 2 on the second, etc. until it
gets to the value in MRow. Typically it will be used in the loop to refer to
something else.

MRow is just a numeric value of the number input by the user at the start,
with 10 added.

--

HTH

Bob Phillips

"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



  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default What does this do?

Thanks for the folowups guys! now I get it!!

Now that I got the loop worked out,I have another
question...

I want to modify my code to search for a cell with a
specific value in it, then search for ANOTHER cell with a
specific value and then select all the ENTIRE ROWS that
are between the two cells it found.

I've been trying to use the range object to do this, but
I'm so rusty!! I only get to do VBA/Excel programming
about once per year. So, I'm having a hard time with it.
Any pointers??

-----Original Message-----
RH,

RNum is simply a variable used as a counter in the

For ... Next loop. First
time through the loop it will be set to 1, 2 on the

second, etc. until it
gets to the value in MRow. Typically it will be used in

the loop to refer to
something else.

MRow is just a numeric value of the number input by the

user at the start,
with 10 added.

--

HTH

Bob Phillips

"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
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



All times are GMT +1. The time now is 02:51 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"