Insert Text into a different Cell

J

jeff

Hi,

This may be over the top, but you might try it.
Right-click on your tab name, select view code,
and paste it in.

Jeff

Private Sub Worksheet_SelectionChange(ByVal Target As
Range)
If Target.Cells.Count > 1 Then Exit Sub
If Not Application.Intersect(Range("C4:C4"), Target)
Is Nothing Then runMyMacro
End Sub
Sub runMyMacro()
Dim d As Range
Set d = Range("C4")
Select Case d.Value
Case Is = "Airfare"
Range("C5") = "Enter Airline, Flight, Depart,
Destination"
Case Is = "Auto"
Range("C5") = "Do Car"
Case Else
Range("C5") = "Do Other"
End Select
End Sub
-----Original Message-----
I have a list in C4 that contains the following items: Airfare, Car Rental, Mileage.
I want to be able to insert text into C5, depending on
what the user selects in C4. I just want the text entered
into C5 so the user can edit the text, therefor, the
formula can't exist in C5. For Example, if the user
selects Airfare in C4, then I want to display "Enter
Airline, Flight, Depart, Destination".
 
E

Eric Paine

Okay, I'm able to get this to work, here is my code:
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Cells.Count > 1 Then Exit Sub
If Not Application.Intersect(Range("C5:C35"), Target) Is Nothing Then runMyMacro
End Sub
Sub runMyMacro()
Dim d As Range
Set d = Range("C5")
Select Case d.Value
Case Is = "Air Fare - Billable"
Range("F5").Value = "Airline: Flight: Date: DepartFrom: Destination: "
Case Is = "Air Fare - Non Billable"
Range("F5").Value = "Airline: Flight: Date: DepartFrom: Destination: "
Case Is = "Car Rental Expense - Billable"
Range("F5").Value = "DepartFrom: Date: Destination: "
Case Is = "Car Rental Expense - Non Billable"
Range("F5").Value = "DepartFrom: Date: Destination: "
Case Is = "Parking - Billable"
Range("F5").Value = "DepartFrom: Date: Destination: "
Case Is = "Parking - Non Billable"
Range("F5").Value = "DepartFrom: Date: Destination: "
Case Is = "Hotel - Billable"
Range("F5").Value = "HotelName: Location: DateFrom: DateTo: "
Case Is = "Hotel - Non Billable"
Range("F5").Value = "HotelName: Location: DateFrom: DateTo: "
Case Is = "Meals & Entertainment - Billable"
Range("F5").Value = "Purpose: Place: PersonName: PersonTitle: Person Firm: "
Case Is = "Meals & Entertainment - Non Billable"
Range("F5").Value = "Purpose: Place: PersonName: PersonTitle: Person Firm: "
Case Is = "Mileage - Billable"
Range("F5").Value = "From: To:"
Case Is = "Mileage - Non Billable"
Range("F5").Value = "From: To:"
Case Else
Range("F5").Value = ""
End Select
End Sub



Now, anyone know How I can get this to work for every cell in column C so it populates to corresponding column F?
 
Top