add in code

bluefeather8989

Active Member
Joined
Nov 20, 2009
Messages
331
Office Version
  1. 365
Platform
  1. Windows
i have this work sheet code.I need to add in another code with it how do i do that.

Code:
Private Sub Worksheet_Change(ByVal Target As Range)

    If Not Intersect(Target, Range("B8")) Is Nothing Then
        
        
        If Target.Value >= 1 And Target.Value <= 532 And Range("D8").Value <> "" Then
            
        Else
            Application.EnableEvents = False
                Call Blank
            Application.EnableEvents = True
        End If
        
   End If
    
End Sub
need to add this code into the first code
Code:
Private Sub Worksheet_Change(ByVal Target As Range)

    If Not Intersect(Target, Range("B12")) Is Nothing Then
        
        
        If Target.Value >= 1 And Target.Value <= 632 And Range("D12").Value <> "" Then
            
        Else
            Application.EnableEvents = False
                Call Blank_2
            Application.EnableEvents = True
        End If
        
   End If
    
End Sub
then i need a code that says if both B8 and B12 is greater than 100
Call L_StartRace
 

Excel Facts

Quick Sum
Select a range of cells. The total appears in bottom right of Excel screen. Right-click total to add Max, Min, Count, Average.
Does this simple merge not do it?:
Code:
Private Sub Worksheet_Change(ByVal Target As Range)
If Not Intersect(Target, Range("B8")) Is Nothing Then
  If Target.Value >= 1 And Target.Value <= 532 And Range("D8").Value <> "" Then
  Else
    Application.EnableEvents = False
    Call Blank
    Application.EnableEvents = True
  End If
End If
If Not Intersect(Target, Range("B12")) Is Nothing Then
  If Target.Value >= 1 And Target.Value <= 632 And Range("D12").Value <> "" Then
  Else
    Application.EnableEvents = False
    Call Blank_2
    Application.EnableEvents = True
  End If
End If
If Range("B8").Value > 100 And Range("B12").Value > 100 Then L_StartRace
End Sub
 
Last edited:
Upvote 0
Does this simple merge not do it?:
Code:
Private Sub Worksheet_Change(ByVal Target As Range)
If Not Intersect(Target, Range("B8")) Is Nothing Then
  If Target.Value >= 1 And Target.Value <= 532 And Range("D8").Value <> "" Then
  Else
    Application.EnableEvents = False
    Call Blank
    Application.EnableEvents = True
  End If
End If
If Not Intersect(Target, Range("B12")) Is Nothing Then
  If Target.Value >= 1 And Target.Value <= 632 And Range("D12").Value <> "" Then
  Else
    Application.EnableEvents = False
    Call Blank_2
    Application.EnableEvents = True
  End If
End If
If Range("B8").Value > 100 And Range("B12").Value > 100 Then L_StartRace
End Sub
this is great. you rock. cheers:beerchug:
 
Upvote 0

Forum statistics

Threads
1,224,552
Messages
6,179,488
Members
452,917
Latest member
MrsMSalt

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top