Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default 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?

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default 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
  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,986
Default 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?





  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default 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?


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


Similar Threads
Thread Thread Starter Forum Replies Last Post
split post code (zip code) out of cell that includes full address Concord Excel Discussion (Misc queries) 4 October 15th 09 06:59 PM
Shorten code to apply to all sheets except a few, instead of individually naming them, and later adding to code. Corey Excel Programming 3 December 11th 06 05:14 AM
Protect Sheet with code, but then code will not Paste error. How do i get around this. Please read for explainations.... Corey Excel Programming 4 November 25th 06 04:57 AM
Modification in the CODE to HIDE rows and columns that start with ZERO (code given) Thulasiram[_2_] Excel Programming 4 September 26th 06 04:15 AM
Excel code convert to Access code - Concat & eliminate duplicates italia Excel Programming 1 September 12th 06 12:14 AM


All times are GMT +1. The time now is 12:17 AM.

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

About Us

"It's about Microsoft Excel"