explanation

S

ssrvant

Can someone please tell me what this function does. Especially the
"Cells(mycell.Row,4).value = ""

Secondly, what is the association between (mycell.Row, 4) and
Range(N6:N31)

For Each mycell In Range("N6:N31")
'' If mycell.Value > n Then
'' Cells(mycell.Row, 4).Value = ""
'' Cells(mycell.Row, 5).Value = ""
'' End If
 
B

Bob Phillips

It is looping through N6:N31 a cell at a time, mycell points at the current
cell in each iteration of the loop.

--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)
 
G

Guest

Yes, the supplied code is attempting to set the values of the cells in the
range N6:N31 to be empty. That is, to contain the null string ".
The VBA function "Cells" allows the user to specify a cell on the sheet
using row and column referencing. The 4 and 5 refer to column 4 and column 5.
The following line
For Each mycell In Range("N6:N31")
is the VBA method for iterating through an a range object.
The "mycell" variable has unfortunately not been defined. You could replace
the "mycell" variable with "activecell".
Hope that suffices!
Aran Black
 
S

ssrvant

It is looping through N6:N31 a cell at a time, mycell points at the current
cell in each iteration of the loop.

--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)

thank you.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top