ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Macro trigger? (https://www.excelbanter.com/excel-programming/292953-macro-trigger.html)

No Name

Macro trigger?
 
Hi Trot,

If the depending cells are in a fixed column I would use
Vlookup

Assuming you have your Master table in sheet2 ,A1:B2 like:
A 15.000.000
B 10.000.000

Then put in I3, J3 and K3:
=vlookup($f3,sheet2!$a$1:$b$2,2,false)
If you then enter A or B in F3, the result will appear in
the other cells.

Copy this formula down to all the cells you need.

If this is not what you want, please post again

Wolf

-----Original Message-----
If anyone can help me on this one, it would be much

appreciated. I want
to be able to type a letter in a cell and have it

automatically execute
some action. More specifically, I have letter codes I

will be entering
into column F.

For example, I would like to be able to enter the

letter "B" into F2
and have excel place values of 10,000,000 in cells I2

and J2
automatically. Or another case would be entering the

letter "A" in F3
and have excel place values of 15,000,000 in I3, J3, and

K3.

The code "B" would always need the value placed in the 2

cells starting
3 columns to the right of where the code is input.

Likewise, "A" would
always need the associated value placed in the 3 cells

starting 3
columns to the right of the input cell and so on.

I already have tables of the codes and what values they

represent on
another worksheet. I just need to be able to take those

values and have
excel place them in the designated cells automatically

upon entering
the code.

I hope I explained what it is I wish to accomplish.

Thanks again.

Trot


---
Message posted from http://www.ExcelForum.com/

.


trot4

Macro trigger?
 
I appreciate the replies. However, I still need additional guidance.
now know I might not have been as clear as I could have been i
describing what I wanted.

The VLOOKUP sounds like what I need for this. I had used it elsewher
in the workbook and it never crossed my mind to use it there for som
reason. The sheet with the list of codes has 3 columns on it.
Column A -- the various letter codes (i.e. A, B, C, D etc.)
Column B -- the number of cells I need the value in Column C to b
entered (i.e. 1,2,3,4 etc.)
Column C -- the value to be entered (i.e. 5,000,000)

So, after I enter the letter code, I need VLOOKUP to reference column
for that particular code to determine how many cells it needs to plac
the value from Column C in. I hope that made sense. Is this possible
Perhaps with a tweak to what was posted before? Thanks again for you
help so far.

Tro

--
Message posted from http://www.ExcelForum.com


No Name

Macro trigger?
 
Hi Trot,


Assuming that the numbers in your column B are not too
high, you may try the following

1. Name your range, where the basic date is in,
as "myRange" (e.g. a1:c5)

2.Assuming your lookup data is in F5, enter the following
formula

in G5:
=IF($F5="","",IF(VLOOKUP($F5,myRange,2,FALSE)0,VL OOKUP
($F5,myRange,3,FALSE),""))

in H5
=IF($F5="","",IF(VLOOKUP($F5,myRange,2,FALSE)1,VL OOKUP
($F5,myRange,3,FALSE),""))

in I5
=IF($F5="","",IF(VLOOKUP($F5,myRange,2,FALSE)2,VL OOKUP
($F5,myRange,3,FALSE),""))

etc. until the highest possible number for column B ir
reached.

Not very elegant, but it works for me.

Best regards

Wolf

-----Original Message-----
I appreciate the replies. However, I still need

additional guidance. I
now know I might not have been as clear as I could have

been in
describing what I wanted.

The VLOOKUP sounds like what I need for this. I had used

it elsewhere
in the workbook and it never crossed my mind to use it

there for some
reason. The sheet with the list of codes has 3 columns

on it.
Column A -- the various letter codes (i.e. A, B, C, D

etc.)
Column B -- the number of cells I need the value in

Column C to be
entered (i.e. 1,2,3,4 etc.)
Column C -- the value to be entered (i.e. 5,000,000)

So, after I enter the letter code, I need VLOOKUP to

reference column B
for that particular code to determine how many cells it

needs to place
the value from Column C in. I hope that made sense. Is

this possible?
Perhaps with a tweak to what was posted before? Thanks

again for your
help so far.

Trot


---
Message posted from http://www.ExcelForum.com/

.


trot4[_2_]

Macro trigger?
 
Thanks Wolf.

That will do the trick. I just had to change the syntax slightly
taking out the 2nd and 3rd sets of quotes to get it to work. Thanks t
Wolf and the others that assisted me.

Tro

--
Message posted from http://www.ExcelForum.com



All times are GMT +1. The time now is 09:01 PM.

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