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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

using event Worksheet_Change excel

Status
Not open for further replies.

SteIT

Programmer
Nov 22, 2007
18
GB
I am using the event Worksheet_Change to trigger a macro when a value is enter in a range of cells (column J).

How can I run a different macro when a value is entered in a different column (column B).


Regards

SteIT
 




Hi,
Code:
if not intersect(target, activesheet.cells(1,"J").entirecolumn) is nothing then
  macro1
elseif not intersect(target, activesheet..cells(1,"B").entirecolumn) is nothing then
  macro2
end if


Skip,
[sub]
[glasses]Have you heard that the roundest knight at King Arthur's round table was...
Sir Cumference![tongue][/sub]
 
Code:
If target.column = 10 then
  'your code for changes in column J
elseif target.column = 2 then
  'your code for changes in column B
else
  'don't run code
end if

Rgds, Geoff

We could learn a lot from crayons. Some are sharp, some are pretty and some are dull. Some have weird names and all are different colours but they all live in the same box.

Please read FAQ222-2244 before you ask a question
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top