Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default Macro to find the value of adjacent cell from a range of values

Hi,

I am in need of a macro program to find the value of adjacent cell
that is given as input

Consider

Cells
A3 No of Trucks B3 Factor
0 1.1
1 1.3
2 1.55
3 1.6
4 1.8
5 1.96
6 2.1
7 2.25
A12 8 2.4

If Cell A1="No of Trucks" is given a value as 4, macro need to search
the range of value and write the adjacent cell value 1.8 in cell
B1="Factor".
Macro should include the search for value 0 to 8.

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 91
Default Macro to find the value of adjacent cell from a range of values

On Jun 11, 10:23*am, maniarasan wrote:
Hi,

I am in need of a macro program to find the value of adjacent cell
that is given as input

Consider

* Cells
A3 *No of Trucks B3 Factor
* * * * * 0 * * * * * * * * * * 1.1
* * * * * 1 * * * * * * * * * * 1.3
* * * * * 2 * * * * * * * * * * 1.55
* * * * * 3 * * * * * * * * * * 1.6
* * * * * 4 * * * * * * * * * * 1.8
* * * * * 5 * * * * * * * * * * 1.96
* * * * * 6 * * * * * * * * * * 2.1
* * * * * 7 * * * * * * * * * * 2.25
A12 * *8 * * * * * * * * * * 2.4

If Cell A1="No of Trucks" is given a value as 4, macro need to search
the range of value and write the adjacent cell value 1.8 in cell
B1="Factor".
Macro should include the search for value 0 to 8.


Probably VLOOKUP function can do it much easily.

in cell B1 paste the formula
=VLOOKUP(A1,$A$3:$B$12,2,0)

You have to change $A$3:$B$12 to actual table address
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default Macro to find the value of adjacent cell from a range of values

On Jun 11, 10:51*am, Javed wrote:
On Jun 11, 10:23*am, maniarasan wrote:





Hi,


I am in need of a macro program to find the value of adjacent cell
that is given as input


Consider


* Cells
A3 *No of Trucks B3 Factor
* * * * * 0 * * * * * * * * * * 1.1
* * * * * 1 * * * * * * * * * * 1.3
* * * * * 2 * * * * * * * * * * 1.55
* * * * * 3 * * * * * * * * * * 1.6
* * * * * 4 * * * * * * * * * * 1.8
* * * * * 5 * * * * * * * * * * 1.96
* * * * * 6 * * * * * * * * * * 2.1
* * * * * 7 * * * * * * * * * * 2.25
A12 * *8 * * * * * * * * * * 2.4


If Cell A1="No of Trucks" is given a value as 4, macro need to search
the range of value and write the adjacent cell value 1.8 in cell
B1="Factor".
Macro should include the search for value 0 to 8.


Probably VLOOKUP function can do it much easily.

in cell B1 paste the formula
=VLOOKUP(A1,$A$3:$B$12,2,0)

You have to change $A$3:$B$12 to actual table address- Hide quoted text -

- Show quoted text -


Hi,

Can anyone help me with the macro program for above...
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 and transpose adjacent values J.W. Aldridge Excel Programming 1 December 22nd 09 09:53 AM
Find 2 values in adjacent columns simultaneously BigPig Excel Programming 0 June 27th 08 03:01 PM
Find blank cells and clear adjacent range rbel Excel Programming 9 December 12th 07 12:09 AM
Find all cells with "A" and add the values of the adjacent cell to give a total. leefarrell Excel Programming 0 August 9th 06 04:05 PM
Search/Filter to find values in another range based on two cell values Andy Excel Programming 2 April 29th 04 04:08 PM


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