Setting values in a cell

  • Thread starter Thread starter Stephen
  • Start date Start date
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?
 
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
 
I et an object required error when running this. I am sorry but I dont know
enough to debug this.

Thx,
Stephen
 
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
 

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

Back
Top