View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Bob Phillips[_6_] Bob Phillips[_6_] is offline
external usenet poster
 
Posts: 11,272
Default Need help with userform....please....

Try something like

Private Sub CommandButton1_Click()

IncDec txt1Add, True
IncDec txt1Subtract, False
'etc.

End Sub

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

iItem = Evaluate("Match(" & textbox.Text & ", A1:A10, 0)")
If iItem 0 Then
If Increment Then
Cells(iItem, "B").Value = Cells(iItem, "B").Value + 1
Else
Cells(iItem, "B").Value = Cells(iItem, "B").Value - 1
End If
End If

End Sub


--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"marty6 " wrote in message
...
Hi,

I'm very, very new at VBA and excel. I have a problem here at work and
I'm in need of some help. I would like to create a popup menu and be
able to input section numbers which are attached to adjacent cells.
The popup menu will have seven input textboxes under the add column and
seven input textboxes under the subtract column. Here's an example:

section number of items
1001.01 10
1001.02 11
1001.03 09


If I typed in 1001.01 in one of the add textboxes, the number item
increases by one. If I typed in 1001.01 in the subtract textbox, the
item would decrease by one. The rest of the spreadsheet has forumlas
for column totals. So, that being said, can someone help me in
developing an input box(userform) that pops up? I did go to the MS
excel web page in order to learn about how to create a basic userform.
But, what I would like to do is beyond my knowledge. Any help is
appreciated.

BTW. I have 560 section numbers and an equal number of "number of
Items" also.

Thank you,

marty6


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