what happens when this code is run?

X

xtalenaj

Suppose that an Excel spreadsheet contains the value "Hello" in cell A10 but
is otherwise empty when the following code fragment is executed:

Code:
Dim intCounter As Integer

intCounter = 1

Do While Cells(intCounter, 1).Value <> "Hello"
intCounter = intCounter + 1
Loop
After this code fragment is run, the value of intCounter will be what?
 
X

xtalenaj

is homework not allowed?

Don Guillett said:
Homework?

--
Don Guillett
Microsoft MVP Excel
SalesAid Software
(e-mail address removed)
xtalenaj said:
Suppose that an Excel spreadsheet contains the value "Hello" in cell A10
but
is otherwise empty when the following code fragment is executed:

Code:
Dim intCounter As Integer

intCounter = 1

Do While Cells(intCounter, 1).Value <> "Hello"
intCounter = intCounter + 1
Loop
After this code fragment is run, the value of intCounter will be what?
 
D

Dave Peterson

Sometimes it's just simpler to test it.
Suppose that an Excel spreadsheet contains the value "Hello" in cell A10 but
is otherwise empty when the following code fragment is executed:

Code:
Dim intCounter As Integer

intCounter = 1

Do While Cells(intCounter, 1).Value <> "Hello"
intCounter = intCounter + 1
Loop
After this code fragment is run, the value of intCounter will be what?
 
J

JLGWhiz

It is not that homework is not allowed, it just does not help you to learn
very much if someone just gives you the answer. BTW the answer to this one
is that intCounter will equal the number of iterations that the loop makes
before reaching a cell in column A that contains the string "Hello". Were
you expecting a number?

xtalenaj said:
is homework not allowed?

Don Guillett said:
Homework?

--
Don Guillett
Microsoft MVP Excel
SalesAid Software
(e-mail address removed)
xtalenaj said:
Suppose that an Excel spreadsheet contains the value "Hello" in cell A10
but
is otherwise empty when the following code fragment is executed:

Code:
Dim intCounter As Integer

intCounter = 1

Do While Cells(intCounter, 1).Value <> "Hello"
intCounter = intCounter + 1
Loop
After this code fragment is run, the value of intCounter will be what?
 
M

mrsharkspoiler

In the time it took for you to log on, write the question, which
includes the code!! you could have pasted the code in excel to get the
answer.. LOL
 

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