ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Setting values in a cell (https://www.excelbanter.com/excel-discussion-misc-queries/194399-setting-values-cell.html)

Stephen

Setting values in a cell
 
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?

Lars-Åke Aspelin[_2_]

Setting values in a cell
 
On Thu, 10 Jul 2008 10:47:02 -0700, Stephen
wrote:

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

Stephen

Setting values in a cell
 
I et an object required error when running this. I am sorry but I dont know
enough to debug this.

Thx,
Stephen

Gord Dibben

Setting values in a cell
 
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


On Thu, 10 Jul 2008 11:16:08 -0700, Stephen
wrote:

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

Thx,
Stephen




All times are GMT +1. The time now is 01:38 AM.

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