Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I have a macro that I want to apply to a specific worksheet. So that when I
go to the worksheet and change any cell, the sheet will automatically call the macro. I have R4R5Reset already in a module and know I have to go to the specific sheet to do some private sub worksheet_????. I just don't know how to get to call it everytime I change any cell on the sheet. Option Explicit Sub R4R5Reset() 'Define Variables Dim InPutOne, InPutTwo, InPutThree As Double Dim OutPutOne, OutPutTwo As Range Dim Input3 As Range Dim first As Boolean Dim last As Boolean 'Set Variables InPutOne = Range("AA12").Value InPutTwo = Range("C11").Value Set OutPutOne = Range("Y6") Set OutPutTwo = Range("X23") Set Input3 = Range("S16") 'Booleans first = OutPutOne.Value = "UNLATCH" last = OutPutTwo.Value = "LATCH" 'Different scenarios If InPutOne = 0 And InPutTwo = 0 And first Then InPutThree = 0 ElseIf InPutOne = 0 And InPutTwo = 1 Then InPutThree = 1 ElseIf InPutOne = 1 And InPutTwo = 1 Then InPutThree = 1 ElseIf InPutOne = 0 And InPutTwo = 0 And first = False Then InPutThree = 1 first = True ElseIf InPutOne = 1 And InPutTwo = 0 Then InPutThree = 0 End If 'Results If InPutThree = 0 Then OutPutOne.Value = "UNLATCH" OutPutTwo.Value = "" Input3.Value = 0 ElseIf InPutThree = 1 Then OutPutTwo.Value = "LATCH" OutPutOne.Value = "" Input3.Value = 1 End If End Sub |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Worksheet_Change | Excel Programming | |||
Worksheet_change | Excel Programming | |||
worksheet_change vs. calculate, and worksheet_change not running | Excel Programming | |||
worksheet_change vs. calculate, and worksheet_change not running | Excel Programming |