ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Enter data into a cell that already has a function. (https://www.excelbanter.com/excel-worksheet-functions/207770-enter-data-into-cell-already-has-function.html)

alwayslearning

Enter data into a cell that already has a function.
 
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?

Don Guillett

Enter data into a cell that already has a function.
 
Right click sheet tabview codecopy/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

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"alwayslearning" wrote in message
...
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?



Mike H

Enter data into a cell that already has a function.
 
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


"alwayslearning" wrote:

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?



All times are GMT +1. The time now is 03:00 AM.

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