ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   what happens when this code is run? (https://www.excelbanter.com/excel-programming/401258-what-happens-when-code-run.html)

xtalenaj

what happens when this code is run?
 
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?


Don Guillett

what happens when this code is run?
 
Homework?

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"xtalenaj" wrote in message
...
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?



xtalenaj

what happens when this code is run?
 
is homework not allowed?

"Don Guillett" wrote:

Homework?

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"xtalenaj" wrote in message
...
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?




Dave Peterson

what happens when this code is run?
 
Sometimes it's just simpler to test it.

xtalenaj wrote:

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?


--

Dave Peterson

JLGWhiz

what happens when this code is run?
 
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" wrote:

is homework not allowed?

"Don Guillett" wrote:

Homework?

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"xtalenaj" wrote in message
...
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?




[email protected]

what happens when this code is run?
 
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




On Nov 16, 5:58 pm, xtalenaj
wrote:
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?




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

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