Can anyone help me figure this out???? PLEASE???!!!???

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Kind of hard to explain so I will try to set an example:

Each time I type the word "abbey" into a cell, I would like for the next
cell to populate with a monetary value I have assigned. Is this possible??
If someone could just give me a little guidance I could figure it out.

Thanks!
 
Private Sub Worksheet_Change(ByVal Target As Range)
Const WS_RANGE As String = "H1:H10" '<== change to suit

On Error GoTo ws_exit
Application.EnableEvents = False

If Not Intersect(Target, Me.Range(WS_RANGE)) Is Nothing Then
With Target
Select Case LCase(.Value)
Case "abbey": .Offset(0, 1).Value = 12
Case "manse": .Offset(0, 1).Value = 22
'etc
End Select
End With
End If

ws_exit:
Application.EnableEvents = True
End Sub

'This is worksheet event code, which means that it needs to be
'placed in the appropriate worksheet code module, not a standard
'code module. To do this, right-click on the sheet tab, select
'the View Code option from the menu, and paste the code in.


--
---
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)
 
Check VLOOKUP in help, use the cell where you type the word as lookup value
 
Hi,

Say you have a list like below:

A B
1 Abbey $500
2 XXXXX $200
3 YYYYY $150

and you want when you write Abbey in a cell say C1 you can see the amount in
another cell say D1

enter formula below in D1

=VLOOKUP(C1,$A$1:$B$3,2,FALSE)

Thanks,
 

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

Back
Top