Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 17
Default Address of a Cell

Hi Every One

I am relatively new to programming and have benefited greatly from this
forum. I have got another very basic issue which I am unable to address
myself.

I am comparing the smallest value from an array which is stored in variable
"Least" and then, look for the corresponding value in another array with the
following code:

Least = Application.WorksheetFunction.Small(Array, 1)


A = Application.WorksheetFunction.HLookup(Least, Range, 6, False)

I would also like to obtain the cell addresses of the two (The smallest of
"Array" and its correspodning value in "Range".

Kindly help.

Many Thanks

Mallick
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,646
Default Address of a Cell

Try this:
(In my example I replaced "Array" with Range("A1:B6"),
"Range" with Range("C1:G6"))

Least = WorksheetFunction.Small(Range("A1:B6"), 1)
Range("A1:B6").Select
LAddr = Selection.Find(What:=Least, After:=ActiveCell, LookIn:=xlValues,
LookAt _
:=xlWhole, SearchOrder:=xlByRows, SearchDirection:=xlNext,
MatchCase:= _
False, SearchFormat:=False).Address
A = Application.WorksheetFunction.HLookup(Least, Range("C1:G6"), 6, False)
Range("C1:G6").Select
AAddr = Selection.Find(What:=A, After:=ActiveCell, LookIn:=xlValues, LookAt _
:=xlWhole, SearchOrder:=xlByRows, SearchDirection:=xlNext,
MatchCase:= _
False, SearchFormat:=False).Address

Regards,
Stefi

€˛Mallick€¯ ezt Ć*rta:

Hi Every One

I am relatively new to programming and have benefited greatly from this
forum. I have got another very basic issue which I am unable to address
myself.

I am comparing the smallest value from an array which is stored in variable
"Least" and then, look for the corresponding value in another array with the
following code:

Least = Application.WorksheetFunction.Small(Array, 1)


A = Application.WorksheetFunction.HLookup(Least, Range, 6, False)

I would also like to obtain the cell addresses of the two (The smallest of
"Array" and its correspodning value in "Range".

Kindly help.

Many Thanks

Mallick

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 17
Default Address of a Cell


Thanks Steffi for your quick reply.

Its not as simple as I expected it to be. As I mentioned earlier that I am a
bit of novice in VBA, can you please explain your code?

Thanks

Mallick
"Stefi" wrote:

Try this:
(In my example I replaced "Array" with Range("A1:B6"),
"Range" with Range("C1:G6"))

Least = WorksheetFunction.Small(Range("A1:B6"), 1)
Range("A1:B6").Select
LAddr = Selection.Find(What:=Least, After:=ActiveCell, LookIn:=xlValues,
LookAt _
:=xlWhole, SearchOrder:=xlByRows, SearchDirection:=xlNext,
MatchCase:= _
False, SearchFormat:=False).Address
A = Application.WorksheetFunction.HLookup(Least, Range("C1:G6"), 6, False)
Range("C1:G6").Select
AAddr = Selection.Find(What:=A, After:=ActiveCell, LookIn:=xlValues, LookAt _
:=xlWhole, SearchOrder:=xlByRows, SearchDirection:=xlNext,
MatchCase:= _
False, SearchFormat:=False).Address

Regards,
Stefi

€˛Mallick€¯ ezt Ć*rta:

Hi Every One

I am relatively new to programming and have benefited greatly from this
forum. I have got another very basic issue which I am unable to address
myself.

I am comparing the smallest value from an array which is stored in variable
"Least" and then, look for the corresponding value in another array with the
following code:

Least = Application.WorksheetFunction.Small(Array, 1)


A = Application.WorksheetFunction.HLookup(Least, Range, 6, False)

I would also like to obtain the cell addresses of the two (The smallest of
"Array" and its correspodning value in "Range".

Kindly help.

Many Thanks

Mallick

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 17
Default Address of a Cell

Stefi

It was unable to differentiate between integer and double. Forexample, Least
value was 1 and when searched through the Array, it gave the address of the
cell with 1.6 value.

Kindly help to remove this bug. Thanks

Mallick



"Mallick" wrote:


Thanks Steffi for your quick reply.

Its not as simple as I expected it to be. As I mentioned earlier that I am a
bit of novice in VBA, can you please explain your code?

Thanks

Mallick
"Stefi" wrote:

Try this:
(In my example I replaced "Array" with Range("A1:B6"),
"Range" with Range("C1:G6"))

Least = WorksheetFunction.Small(Range("A1:B6"), 1)
Range("A1:B6").Select
LAddr = Selection.Find(What:=Least, After:=ActiveCell, LookIn:=xlValues,
LookAt _
:=xlWhole, SearchOrder:=xlByRows, SearchDirection:=xlNext,
MatchCase:= _
False, SearchFormat:=False).Address
A = Application.WorksheetFunction.HLookup(Least, Range("C1:G6"), 6, False)
Range("C1:G6").Select
AAddr = Selection.Find(What:=A, After:=ActiveCell, LookIn:=xlValues, LookAt _
:=xlWhole, SearchOrder:=xlByRows, SearchDirection:=xlNext,
MatchCase:= _
False, SearchFormat:=False).Address

Regards,
Stefi

€˛Mallick€¯ ezt Ć*rta:

Hi Every One

I am relatively new to programming and have benefited greatly from this
forum. I have got another very basic issue which I am unable to address
myself.

I am comparing the smallest value from an array which is stored in variable
"Least" and then, look for the corresponding value in another array with the
following code:

Least = Application.WorksheetFunction.Small(Array, 1)


A = Application.WorksheetFunction.HLookup(Least, Range, 6, False)

I would also like to obtain the cell addresses of the two (The smallest of
"Array" and its correspodning value in "Range".

Kindly help.

Many Thanks

Mallick

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
=HYPERLINK("#"&CELL("address", ADDRESS(MATCH(VALUE(B3),QuoteNotes, sarah Excel Worksheet Functions 2 February 17th 09 02:59 PM
=HYPERLINK("#"&CELL("address", ADDRESS(MATCH(VALUE(B3),Range ... ? sarah Excel Worksheet Functions 0 February 17th 09 02:06 PM
Return cell address of a cell based on contents of cell. Danny Excel Worksheet Functions 4 November 15th 08 03:11 AM
How to create table of cell names with the name's cell address WildwoodEngr Excel Discussion (Misc queries) 1 October 26th 06 02:52 PM
store cell contents and cell address for comparsion & suming Jim Whelchel Excel Programming 1 November 24th 04 04:03 PM


All times are GMT +1. The time now is 07:13 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"