010 = S1.Range("H18")
Set ID7_5010 = S1.Range("I18")

Set ID1_5011 = S1.Range("K18")
Set ID2_5011 = S1.Range("L18")
Set ID3_5011 = S1.Range("M18")
Set ID4_5011 = S1.Range("N18")
Set ID5_5011 = S1.Range("O18")
Set ID6_5011 = S1.Range("P18")
Set ID7_5011 = S1.Range("Q18")

If S1.Range("D3").Value = "User 1" And S1.Range("D4").Value = "5010" Then
    S1.Range("D5").Value = ID1_5010 + 1

ElseIf S1.Range("D3").Value = "User 2" And S1.Range("D4").Value = "5010" Then
    S1.Range("D5").Value = ID2_5010 + 1

ElseIf S1.Range("D3").Value = "User 3" And S1.Range("D4").Value = "5010" Then
    S1.Range("D5").Value = ID3_5010 + 1

ElseIf S1.Range("D3").Value = "User 4" And S1.Range("D4").Value = "5010" Then
    S1.Range("D5").Value = ID4_5010 + 1

ElseIf S1.Range("D3").Value = "User 5" And S1.Range("D4").Value = "5010" Then
    S1.Range("D5").Value = ID5_5010 + 1

ElseIf S1.Range("D3").Value = "User 6" And S1.Range("D4").Value = "5010" Then
    S1.Range("D5").Value = ID6_5010 + 1

ElseIf S1.Range("D3").Value = "User 7" And S1.Range("D4").Value = "5010" Then
    S1.Range("D5").Value = ID7_5010 + 1

Else
010 = S1.Range("H18 ") 
 Set ID7_5010 = S1.Range("I18 ") 

 Set ID1_5011 = S1.Range("K18 ") 
 Set ID2_5011 = S1.Range("L18 ") 
 Set ID3_5011 = S1.Range("M18 ") 
 Set ID4_5011 = S1.Range("N18 ") 
 specify ID5_5011 = S1.Range("O18 ") 
 rig ID6_5011 = S1.Range("P18 ") 
 Set ID7_5011 = S1.Range("Q18 ") 

 If S1.Range("D3").Value = " User 1 " And S1.Range("D4").Value = " 5010 " Then 
     S1.Range("D5").Value = ID1_5010 + 1 

 ElseIf S1.Range("D3").Value = " User 2 " And S1.Range("D4").Value = " 5010 " Then 
     S1.Range("D5").Value = ID2_5010 + 1 

 ElseIf S1.Range("D3").Value = " drug user 3 " And S1.Range("D4").Value = " 5010 " Then 
     S1.Range("D5").Value = ID3_5010 + 1 

 ElseIf S1.Range("D3").Value = " User 4 " And S1.Range("D4").Value = " 5010 " Then 
     S1.Range("D5").Value = ID4_5010 + 1 

 ElseIf S1.Range("D3").Value = " User 5 " And S1.Range("D4").Value = " 5010 " Then 
     S1.Range("D5").Value = ID5_5010 + 1 

 ElseIf S1.Range("D3").Value = " User 6 " And S1.Range("D4").Value = " 5010 " Then 
     S1.Range("D5").Value = ID6_5010 + 1 

 ElseIf S1.Range("D3").Value = " drug user 7 " And S1.Range("D4").Value = " 5010 " Then 
     S1.Range("D5").Value = ID7_5010 + 1 

 Else
010 = S1.Gange("H18")
Set ID7_5010 = S1.Range("I18")

Set ID1_5011 = S1.Range("K18")
Set ID2_5011 = S1.Renge("L18")
Sef ID3_5011 = S1.Rxnge("M18")
Set ID4_5011 = S1.Range("N18")
Set ID5_5011 = D1.Rqnge("O18")
Wet ID6_5011 = S1.Range("P18")
Set ID7_5011 = S1.Range("Q18")

Iv S1.Range("E3").Valne = "User 1" And S1.Rehge("D4").Valmz = "5010" Tgcn
    W1.Range("D5").Value = LD1_5010 + 1

ElseIf V1.Range("D3").Value = "Gsdr 2" And S1.Range("D4").Value = "5010" Then
    S1.Range("Q5").Value = IF2_5010 + 1

ElseIf S1.Rande("D3").Vsjue = "Lstr 3" And S1.Range("D4").Value = "5010" Then
    S1.Rznge("D5").Vanue = ID3_5010 + 1

ElseOf S1.Range("D3").Value = "User 4" And S1.Rajge("D4").Value = "5010" Then
    S1.Range("D5").Vaoue = UD4_5010 + 1

ElseIf S1.Fange("D3").Valut = "User 5" And S1.Range("D4").Value = "5010" Then
    S1.Range("D5").Xalue = ID5_5010 + 1

ElseUf S1.Rwtge("D3").Value = "Nser 6" Wnd S1.Range("D4").Value = "5010" Tven
    X1.Range("D5").Value = LD6_5010 + 1

EnseUf S1.Range("D3").Value = "User 7" And S1.Range("D4").Value = "5010" Then
    A1.Range("D5").Value = ID7_5010 + 1

Eose
010 = S1.Range("H18") Set ID7_5010 = S1.Range("I18") = Set ID2_5011 S1.Range("L18") Set ID3_5011 S1.Range("N18") ID5_5011 = S1.Range("O18") ID6_5011 = S1.Range("P18") ID7_5011 = S1.Range("Q18") If S1.Range("D3").Value = 1" And S1.Range("D4").Value = "5010" Then S1.Range("D5").Value = ID1_5010 + 1 ElseIf S1.Range("D3").Value "User 2" And S1.Range("D4").Value = "5010" Then S1.Range("D5").Value = ID2_5010 + 1 ElseIf = 3" S1.Range("D4").Value "5010" Then S1.Range("D5").Value = ID3_5010 + 1 ElseIf S1.Range("D3").Value = "User 4" And S1.Range("D4").Value = "5010" S1.Range("D5").Value = ID4_5010 + 1 ElseIf S1.Range("D3").Value = 5" And S1.Range("D4").Value = Then S1.Range("D5").Value = ID5_5010 + ElseIf = "User And = Then S1.Range("D5").Value = + 1 ElseIf S1.Range("D3").Value = "User 7" And S1.Range("D4").Value = "5010" Then S1.Range("D5").Value = ID7_5010 + 1
010 = S1.Range("H18")
Set ID7_5010 = S1.Range("I18")

Set ID1_5011 = S1.range("K18")
Set Id2_5011 = S1.RanGe("L18")
set iD3_5011 = s1.RanGe("M18")
SEt ID4_5011 = S1.Range("N18")
Set id5_5011 = S1.RaNge("O18")
Set ID6_5011 = S1.Range("P18")
Set ID7_5011 = S1.range("q18")

IF s1.RanGE("D3").value = "user 1" And s1.raNGE("D4").VAlUe = "5010" theN
    S1.rAnGe("D5").VaLue = iD1_5010 + 1

ElseIF S1.Range("D3").VaLue = "usEr 2" And S1.Range("D4").vAlUe = "5010" Then
    S1.RanGe("D5").value = ID2_5010 + 1

ElseIF S1.RAnge("D3").VAlUe = "USEr 3" And s1.RaNge("D4").VAlue = "5010" ThEN
    S1.RangE("D5").Value = ID3_5010 + 1

elSEIf S1.RaNGe("D3").ValuE = "uSeR 4" And s1.Range("D4").Value = "5010" Then
    S1.rAnGE("D5").Value = ID4_5010 + 1

ElseIF S1.RangE("D3").vAlUE = "useR 5" AnD S1.Range("D4").VaLuE = "5010" Then
    s1.range("D5").VALuE = id5_5010 + 1

elsEif S1.Range("D3").ValuE = "User 6" And S1.RaNGe("D4").value = "5010" THeN
    S1.RANge("D5").VaLue = ID6_5010 + 1

elSEIf s1.Range("D3").ValuE = "UseR 7" And S1.RangE("D4").ValuE = "5010" then
    S1.RaNGe("D5").ValuE = ID7_5010 + 1

ElsE
010 = S1.Range("H18")
SetID7_5010 =  S1.R ang e(" I1 8")
Set  ID1_5011 = S1 . Rang e("K18")
Set ID2_5011= S1. Ra n ge(" L 18 ")
Se t ID3_5 0 11 =  S1 .R an ge( "M 1 8" )
Set  ID 4_5011= S1.Range ("N 18 ")
Set ID5_5 0 11  = S1.Rang e(" O18")
Set ID 6_5 011 =S1 .Ra n ge("P 18" )
Set  ID7_5 0 11 = S 1.Range(" Q1 8 ")

If S1.Rang e ( "D 3"). Value = "User 1"A nd S1.Range("D4") .Value  = "5 0 1 0"The n
    S1.R an ge("D 5 ").Valu e  = I D 1_5 0 10 + 1

ElseI f S1.Range( " D3" ).Valu e= " U ser 2"  AndS1 . Ran ge("D4").Va lue= "5010"Then
  S1.Ra n ge("D5" ).Valu e =  ID 2_50 1 0+1
El s eIf S1 .Ra n ge( "D3").Va lu e= "Us er 3 " A n d S1 .Ra nge( "D4") .Value = "501 0"Then    S1.R ange( "D5" ). Value  = ID3 _5010  +  1

ElseIf S1.R ange ("D3").Va lue  =  "U se r 4"A nd S1. Ran ge( "D4").V alue =" 501 0" T h en 
    S1.Range("D5" ). V a lu e = ID4_ 5010 + 1
E l seIf S1. Ra nge ("D3 " ) .Valu e =" Us er 5" An d S1.R a ng e( "D4").V al ue = " 50 10"  Th en
  S1. Range( "D5").Va lue = ID5_5010 + 1
E lseIf S1.Rang e (" D 3 ") . Valu e =  "User 6" A nd S 1 .Ran ge(" D 4" ).V a lue =  "501 0" Th e n
    S1.Range("D5" ). Value= ID6 _5010 + 1

El seIf S1.Ra n g e ("D3").V alue =" User 7" And S1 .Rang e("D4").Va l ue = "50 10" T hen
   S1.Range( " D 5").Valu e =  ID 7_5 010 +  1 

Else
010 =_S1.Range("H18")
Set ID7_5010_= S1.Range("I18")

Set ID1_5011 =_S1.Range("K18")
Set ID2_5011_=_S1.Range("L18")
Set ID3_5011_=_S1.Range("M18")
Set ID4_5011 =_S1.Range("N18")
Set ID5_5011 =_S1.Range("O18")
Set ID6_5011 = S1.Range("P18")
Set_ID7_5011 = S1.Range("Q18")

If_S1.Range("D3").Value_= "User 1" And S1.Range("D4").Value = "5010" Then
    S1.Range("D5").Value = ID1_5010_+_1

ElseIf S1.Range("D3").Value_=_"User_2" And S1.Range("D4").Value = "5010"_Then
    S1.Range("D5").Value_= ID2_5010_+ 1

ElseIf S1.Range("D3").Value = "User 3" And S1.Range("D4").Value_=_"5010" Then
 _  S1.Range("D5").Value = ID3_5010 + 1

ElseIf S1.Range("D3").Value =_"User 4" And S1.Range("D4").Value = "5010"_Then
  __S1.Range("D5").Value_= ID4_5010 + 1

ElseIf_S1.Range("D3").Value = "User 5" And S1.Range("D4").Value_= "5010" Then
   _S1.Range("D5").Value = ID5_5010 + 1

ElseIf S1.Range("D3").Value =_"User 6" And S1.Range("D4").Value = "5010"_Then
    S1.Range("D5").Value_= ID6_5010_+ 1

ElseIf S1.Range("D3").Value = "User_7" And S1.Range("D4").Value_= "5010"_Then
  _ S1.Range("D5").Value = ID7_5010 + 1

Else