Private Sub nxt_Click()
txtDate2.Value = txtDate2.Value + 1
With Application.WorksheetFunction
Me.SME.Caption = Format(.SumIf(Range("c11:c375"), txtDate2, Range("i11:i375")), "$##,###0.00")
Me.TME.Caption = Format(.SumIf(Range("c11:c375"), txtDate2, Range("J11:J375")), "$##,###0.00")
Me.EAR1.Caption = Format(.SumIf(Range("c11:c375"), txtDate2, Range("G11:G375")), "$##,###0.00")
Me.EAR2.Caption = Format(.SumIf(Range("c11:c375"), txtDate2, Range("G11:G375")), "$##,###0.00")
Me.NME1.Caption = Format(Val(Replace(Replace(Me.SME.Caption, "$", ""), ",", "")) - Val(Replace(Replace(Me.EAR1.Caption, "$", ""), ",", "")), "$##,###0.00")
Me.NME2.Caption = Format(Val(Replace(Replace(Me.TME.Caption, "$", ""), ",", "")) - Val(Replace(Replace(Me.EAR2.Caption, "$", ""), ",", "")), "$##,###0.00")
Me.TDME1.Caption = Format(Val(Range("AJ11").Value) * Val(Replace(Replace(Me.NME1.Caption, "$", ""), ",", "")), "$##,###0.00")
Me.TDME2.Caption = Format(Val(Range("AJ11").Value) * Val(Replace(Replace(Me.NME2.Caption, "$", ""), ",", "")), "$##,###0.00")
End With
End Sub
'......................................
Private Sub Prev_Click()
txtDate2.Value = txtDate2.Value - 1
With Application.WorksheetFunction
Me.SME.Caption = Format(.SumIf(Range("c11:c375"), txtDate2, Range("i11:i375")), "$##,###0.00")
Me.TME.Caption = Format(.SumIf(Range("c11:c375"), txtDate2, Range("J11:J375")), "$##,###0.00")
Me.EAR1.Caption = Format(.SumIf(Range("c11:c375"), txtDate2, Range("G11:G375")), "$##,###0.00")
Me.EAR2.Caption = Format(.SumIf(Range("c11:c375"), txtDate2, Range("G11:G375")), "$##,###0.00")
Me.NME1.Caption = Format(Val(Replace(Replace(Me.SME.Caption, "$", ""), ",", "")) - Val(Replace(Replace(Me.EAR1.Caption, "$", ""), ",", "")), "$##,###0.00")
Me.NME2.Caption = Format(Val(Replace(Replace(Me.TME.Caption, "$", ""), ",", "")) - Val(Replace(Replace(Me.EAR2.Caption, "$", ""), ",", "")), "$##,###0.00")
Me.TDME1.Caption = Format(Val(Range("AJ11").Value) * Val(Replace(Replace(Me.NME1.Caption, "$", ""), ",", "")), "$##,###0.00")
Me.TDME2.Caption = Format(Val(Range("AJ11").Value) * Val(Replace(Replace(Me.NME2.Caption, "$", ""), ",", "")), "$##,###0.00")
End With
End Sub