View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
TyeJae[_21_] TyeJae[_21_] is offline
external usenet poster
 
Posts: 1
Default Am I doing something wrong here?

Here is my formula:
---------------------------------------------------------------------

Private Sub Worksheet_SelectionChange(ByVal Target As Range)

Dim a As Boolean
Dim b As Boolean
Dim c As Boolean
b = Range("Goal1").Value
c = Range("Goal2").Value
a = False
For x = 6 To 53
If c = 0 Then a = False
If Cells(x, 3).Value = 1 And a = False Then
Range(Cells(x, 13), Cells(x, 13)).Value = "1"
Range(Cells(x, 14), Cells(x, 32)).Value = "-"
a = True
b = b - 1
ElseIf Cells(x, 3).Value = 1 And a = True Then
Range(Cells(x, 13), Cells(x, 22)).Value = "-"
Range(Cells(x, 23), Cells(x, 23)).Value = "1"
Range(Cells(x, 24), Cells(x, 32)).Value = "-"
a = False
c = c - 1
End If
Next x

For x = 6 To 53
If Cells(x, 3).Value = 0 Then
Range(Cells(x, 13), Cells(x, 32)).Value = "-"
End If
Next x

End Sub

---------------------------------------------------------------------

I want it to subtract from Goal1 or Goal2 everytime it runs that par
of the program but not subtract from those cells. Can anyone help m
with this?

Thanks,
TyeJa

--
Message posted from http://www.ExcelForum.com