Getting in xcel in 1 cell txt valua based on number in other cell

J

jack van oorsouw

Hello,
newby in xcel.
I am working on a userform.
in cell a1 you would select from list 1-25 a valua, this is put in cell a1.
Based on valua of a1 in a 2 would be a txt message.
example
a1 a2
1 text 1
2 text 2
3 text 3
etc
25 text 25
valua a1 is coming from selection list 1-25
what would be the eassiest way to set this up.

many thanks in advance
jack

Submitted via EggHeadCafe
ASP.NET Generic Cookie Utility Class
http://www.eggheadcafe.com/tutorial...66a7/aspnet-generic-cookie-utility-class.aspx
 
G

GS

jack van oorsouw pretended :
Hello,
newby in xcel.
I am working on a userform.
in cell a1 you would select from list 1-25 a valua, this is put in cell a1.
Based on valua of a1 in a 2 would be a txt message.
example
a1 a2
1 text 1
2 text 2
3 text 3
etc
25 text 25
valua a1 is coming from selection list 1-25
what would be the eassiest way to set this up.

many thanks in advance
jack

Submitted via EggHeadCafe
ASP.NET Generic Cookie Utility Class
http://www.eggheadcafe.com/tutorial...66a7/aspnet-generic-cookie-utility-class.aspx

Well.., your use of the term 'easiest way to set this up' is a bit
ominous. You might be better off using a dropdown in the ColumnA and a
formula using the HLookup function in ColumnB (or wherever), where your
25 text values are stored in row2 of (hidden) rows(1:2) and your 1-25
value choices are stored in row1. Give Range("A1:Y2") a locally defined
name something like "TextChoices". Enter this formula in whatever
column to the right of Column("A") you want the result put into.

=HLOOKUP($A3,TextChoices,2,False)

Optionally, you could store the lookup range on a hidden sheet,
vertical or horizontal, and use VLOOKUP or HLOOKUP. Give the sheet a
name something like "TextValues" and edit the above formula as follows.

=HLOOKUP($A3,'TextValues'!TextChoices,2,False)
OR
=VLOOKUP($A3,'TextValues'!TextChoices,2,False)
 
R

Ratheesh

Hello,
newby in xcel.
I am working on a userform.
in cell a1 you would select from list 1-25 a valua, this is put in cell a1.
Based on valua of a1 in a 2 would be a txt message.
example
a1   a2
1    text 1
2    text 2
3    text 3
etc
25   text 25
valua a1 is coming from selection list 1-25
what would be the eassiest way to set this up.

many thanks in advance
jack

Submitted via EggHeadCafe
ASP.NET Generic Cookie Utility Classhttp://www.eggheadcafe.com/tutorials/aspnet/e7108c33-1cc6-48ae-9f65-c...

Hi Jack,

In Excel you can use the inbuilt function ="Your Text " & A1

In VBA you can use the below code execution while value change in A1
Sheets("YourSheetName").Cells(2, 1) = "Your Text " & _
Sheets("YourSheetName").Cells(1, 1)

If it is a userform, you can use the same logic, but the number would
be the textbox value instead of the cell reference.

Ratheesh
 
V

Vacuum Sealed

Jack

The other option might be to use a Lookup.

you could have another sheet "YourOtherSheet" with a list of the numbers and
their respective responses.

A B

1 Your Message#1
2 Your Message#2
3 Your Message#3

Etc

Back to your Main sheet

In Cell B1

=Vlookup(A1,YourOtherSheetName!A1:B25,2,False)

Not sure if you will need to copy the formula down to other cells below, but
if you do, then do as required.

HTH
Mick
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top