Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 84
Default loop i think

i have a list (a1:a20) where one cell in that row will have a value...all the
others will be blank. i need to have whatever cell has a value, to be
inputted into B1.
im thinking that i need a loop function, but im not too familiar with it

Thank you

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,302
Default loop i think

Hi Choice,

Try:

Range("B1").Value = Range("A21").End(xlUp).Value


---
Regards,
Norman



"choice" wrote in message
...
i have a list (a1:a20) where one cell in that row will have a value...all
the
others will be blank. i need to have whatever cell has a value, to be
inputted into B1.
im thinking that i need a loop function, but im not too familiar with it

Thank you



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 634
Default loop i think

Do you really need code? If it is exactly as you say and numeric then in B1
simply put

=MAX(A1:A20)

or even

=LOOKUP(9.99999999999999E+307,A1:A20) for last numeric entry in a column


If it is text then

=LOOKUP(REPT("z",255),A1:A20) for last text entry in a column

--
Regards
Ken....................... Microsoft MVP - Excel
Sys Spec - Win XP Pro / XL 97/00/02/03

----------------------------------------------------------------------------
It's easier to beg forgiveness than ask permission :-)
----------------------------------------------------------------------------



"choice" wrote in message
...
i have a list (a1:a20) where one cell in that row will have a value...all the
others will be blank. i need to have whatever cell has a value, to be
inputted into B1.
im thinking that i need a loop function, but im not too familiar with it

Thank you



---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.760 / Virus Database: 509 - Release Date: 10/09/2004


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 12
Default loop i think

One way would be:-

For c = 1 To 20
If Cells(c, 1) "" Then
Cells(1, 2) = Cells(c, 1)
End If
Next c

"choice" wrote in message
...
i have a list (a1:a20) where one cell in that row will have a value...all

the
others will be blank. i need to have whatever cell has a value, to be
inputted into B1.
im thinking that i need a loop function, but im not too familiar with it

Thank you



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,624
Default loop i think

If the value is numeric, use

B1: =SUM(A1:A20)

If the value is text, array-enter (CTRL-SHIFT-ENTER or CMD-RETURN):


B1: =INDEX(A:A,MATCH(TRUE,(A1:A20<""),FALSE))

In article ,
choice wrote:

i have a list (a1:a20) where one cell in that row will have a value...all the
others will be blank. i need to have whatever cell has a value, to be
inputted into B1.
im thinking that i need a loop function, but im not too familiar with it

Thank you



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 84
Default loop i think

i cant use an equation, because at other times i want to type text into the
same cell...so i need VBA to enter in the value, then print then delete

"JE McGimpsey" wrote:

If the value is numeric, use

B1: =SUM(A1:A20)

If the value is text, array-enter (CTRL-SHIFT-ENTER or CMD-RETURN):


B1: =INDEX(A:A,MATCH(TRUE,(A1:A20<""),FALSE))

In article ,
choice wrote:

i have a list (a1:a20) where one cell in that row will have a value...all the
others will be blank. i need to have whatever cell has a value, to be
inputted into B1.
im thinking that i need a loop function, but im not too familiar with it

Thank you


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
Find loop doesn't loop JSnow Excel Discussion (Misc queries) 2 June 24th 09 08:28 PM
Help with a loop Peter Excel Programming 7 May 25th 04 09:34 PM
Loop Esau Excel Programming 6 May 3rd 04 12:09 AM
Worksheet_Change - loop within a loop bgm Excel Programming 1 January 19th 04 01:27 PM
HELP!!!! Can't stop a loop (NOT an infinite loop) TBA[_2_] Excel Programming 3 December 14th 03 03:33 PM


All times are GMT +1. The time now is 07:29 PM.

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"