Setting values in a cell

S

Stephen

I created a flow chart in excel 2003. I want to set the value in cell M6 to
Y if i select cell B10 and N if I select cell C10. Any thoughts?
 
L

Lars-Åke Aspelin

I created a flow chart in excel 2003. I want to set the value in cell M6 to
Y if i select cell B10 and N if I select cell C10. Any thoughts?

Try this:

Sub Worksheet_SelectionChange(ByVal Target As Range)
If Not Intersect(Target, Range("B10")) Is Nothing Then
Cells(6, "M") = "Y"
ElseIf Not Intersect(Target, Range("C10")) Is Nothing Then
Cells(6, "M") = "N"
End If
End Sub

Hope this helps! / Lars-Åke
 
S

Stephen

I et an object required error when running this. I am sorry but I dont know
enough to debug this.

Thx,
Stephen
 
G

Gord Dibben

The code Lars posted is sheet event code and must be placed in the worksheet.

Right-click on the sheet tab and "View Code".

Copy/paste the code into that module.

Alt + q to return to the Excel window.

Select B10 and see Y appear in M6

Select C10 and see N appear in M6


Gord Dibben MS Excel MVP
 
Top