ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   macro triggered by a change to a cell (https://www.excelbanter.com/excel-programming/303163-macro-triggered-change-cell.html)

Lee

macro triggered by a change to a cell
 
I want a macro ("WWW") to run wheneven I change the
selection in a combobox (located in sheet "XX"
Cell "Q2")? How do I write "WWW"? thanks much.

Juan Sanchez

macro triggered by a change to a cell
 

In XX sheet's view code...

Private Sub Worksheet_Change(ByVal Target As Range)
Dim rng As Range
Set rng = [Q2]

If Intersect(Target, rng) Is Nothing Then Exit Sub

'write your code here

End Sub

Cheers
Juan






-----Original Message-----
I want a macro ("WWW") to run wheneven I change the
selection in a combobox (located in sheet "XX"
Cell "Q2")? How do I write "WWW"? thanks much.
.


Lee

macro triggered by a change to a cell
 
Thanks, but it didn't seem to run? Should I
define "Target"? and Should I output the selection made by
the combbox to cell "Q2"? thanks.
-----Original Message-----

In XX sheet's view code...

Private Sub Worksheet_Change(ByVal Target As Range)
Dim rng As Range
Set rng = [Q2]

If Intersect(Target, rng) Is Nothing Then Exit Sub

'write your code here

End Sub

Cheers
Juan






-----Original Message-----
I want a macro ("WWW") to run wheneven I change the
selection in a combobox (located in sheet "XX"
Cell "Q2")? How do I write "WWW"? thanks much.
.

.



All times are GMT +1. The time now is 03:43 AM.

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