View Single Post
  #9   Report Post  
Posted to microsoft.public.excel.programming
marty6[_6_] marty6[_6_] is offline
external usenet poster
 
Posts: 1
Default Need help with userform....please....

Hi Bob,

I had a little progress today. Here's what I've got so far:

Private Sub CommandButton1_click()

IncDec Txt1Add, True
IncDec Txt2Add, True
IncDec Txt3Subtract, True
IncDec Txt4Subtract, True
End Sub


Private Sub IncDec(textbox As msforms.textbox, Increment As Boolean)
Dim iItem As Long

iItem = Evaluate("Match(" & Txt1Add.Text = "1001.01" & ",B1 +1, 0)")
If iItem 0 Then
If Increment Then
Cells(1, iItem).Value = Cells(1, iItem).Value + 1
End If
End If
iItem = Evaluate("Match(" & Txt2Add.Text = "1001.01" & ",1, 0)")
If iItem 0 Then
If Increment Then
Cells(1, iItem).Value = Cells(1, iItem).Value + 1
End If
End If
iItem = Evaluate("Match(" & Txt3Subtract = "1001.01" & "1, 0)")
If iItem 0 Then
If Increment Then
Cells(1, iItem).Value = Cells(1, iItem).Value - 1
End If
End If
iItem = Evaluate("Match(" & Txt4Subtract = "1001.01" & ", 1, 0)")
If iItem 0 Then
If Increment Then
Cells(1, iItem).Value = Cells(1, iItem).Value - 1
End If
End If

End Sub



Private Sub CommandButton3_Click()
End
End Sub

_______________________________________________

So far, I did get rid of some of the errors. If you noticed that ther
is "1001.01". For some reason the debugging program was asking fo
this. I find this interesting. Other than that the userform stil
does not work.

Can we start over? I'm getting alittle lost at this point. I spent
hrs yesterday trying to figure it out.

Here's what I have in this arrangement. If you could, could you follo
it in your excel program and see what you come up with as a possibl
solution:

Column A
In cell A1 is 1001.01
In cell A2 is 1001.02

Column B
In cell B1 is 10
In cell B2 is 10

Create a userform with 4 inputboxes(textboxes)
two boxes per column. The heading of the left column will be "Add" an
the heading for the right column is "subtract"
Name your userboxes: (1st one on the upper left as "txt1Add", 2nd on
on the bottom left is "txt2Add". 3rd one on the upper right i
"txt3Subtract", and finally "txt4Subtract" for the bottom right.

Then create two bottons on the bottom of the userform:
"Enter" and "Exit".

What I'm trying to obtain is the ability to type in the section numbe
"1001.01" in either txt1Add or txt2Add in order to increase the numbe
from 10 to 11. Also, trying just the opposite, typing in "1001.01" i
either txt3subtract or txt4subtract in order to go from 10 to 9. I'
also trying to do this with any section number.

I guess I got overwhelmed and confused on this part of the process.

Any of your help is much appreciated

marty

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