Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

formula developement 1

Status
Not open for further replies.

butchkmd

Programmer
Nov 13, 2001
83
US
To all who have helped with the previous posts I thank you again. That issue is resolved. My trouble now is creating a formula that evaluates the text in one cell and depending on what it is change the text in another.

ex

cell a1 = "sunglasses"

now if cell a1 on sheet2 = "Always dark"
I need to remove the "Sunglasses" from the first cell.

I've come up with some code but I have trouble placeing the value on a different sheet

Thanks
M
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Dim tText$

If ActiveCell.Address = ("$A$8") Then
With Range("a8")
tText = Range("a8").Value
Select Case tText
Case "S"
Sheet1.Select
Range("a1").Value = "Ride"
Exit Sub
Case "P"
Sheet1.Select
Range("a1").Value = "Sleep"
Exit Sub
End Select
End With
End If

End Sub
 
All seems ok - but you don't need to select the sheet to put data in it - just use :
Sheets("Sheet1").range("a1").value = "whatever"

HTH
Geoff
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top