Enter data into a cell that already has a function.

A

alwayslearning

Cell B4's value is predicated on the value of cell A4. If cell A4 has a
particular value, I need to be able to type data into cell B4.

A4 = "Dodge" then B4="1"
A4="Ford" then B4="2"
A4="Chevy" then B4="3"
but is A4="Pickup" then B4= data to be typed in

Is there a way to keep the function and still be able to type data into cell
B4?
 
D

Don Guillett

Right click sheet tab>view code>copy/paste this.

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address <> Range("a4").Address Then Exit Sub
Select Case UCase(Target)
Case "DODGE": x = 1
Case "FORD": x = 2
Case "CHEVY": x = 3
Case "PICKUP": x = InputBox("Enter Data")
Case Else
MsgBox "No data entered"
End Select
Range("b4").Value = x
End Sub
 
M

Mike H

Hi,

Entering a value into B4 will overwrite the formula so no is the answer.

However suppose your formula in b4 is something like this

=IF(A4="Dodge",1,0)

you could select B4 in the formula bar and with the ampersand add something
to the end of the formula

=IF(A4="Dodge",1,0) & "Someething else I want "

Mike
 

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