LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #9   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Need help with userform....please....

Marty,

I posted this in response to your other question

Private Sub CommandButton1_Click()
IncDec txt1Add, True
IncDec txt1Subtract, False
IncDec txt2Add, True
IncDec txt2Subtract, False
IncDec txt3Add, True
IncDec txt3Subtract, False
IncDec txt4Add, True
IncDec txt4Subtract, False
IncDec txt5Add, True
IncDec txt5Subtract, False
IncDec txt6Add, True
IncDec txt6Subtract, False
IncDec txt7Add, True
IncDec txt7Subtract, False
End Sub

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

On Error GoTo incdec_exit
iItem = Evaluate("Match(" & textbox.Text & ",A1:H1, 0)")
If iItem Then
If Increment Then
Cells(2, iItem).Value = Cells(2, iItem).Value + 1
Else
Cells(2, iItem).Value = Cells(2, iItem).Value - 1
End If
End If
incdec_exit:
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 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 there
is "1001.01". For some reason the debugging program was asking for
this. I find this interesting. Other than that the userform still
does not work.

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

Here's what I have in this arrangement. If you could, could you follow
it in your excel program and see what you come up with as a possible
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" and
the heading for the right column is "subtract"
Name your userboxes: (1st one on the upper left as "txt1Add", 2nd one
on the bottom left is "txt2Add". 3rd one on the upper right is
"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 number
"1001.01" in either txt1Add or txt2Add in order to increase the number
from 10 to 11. Also, trying just the opposite, typing in "1001.01" in
either txt3subtract or txt4subtract in order to go from 10 to 9. I'm
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

marty6


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



 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
UserForm bgkgmg Excel Worksheet Functions 1 February 26th 09 04:25 PM
UserForm FSt1 Excel Worksheet Functions 0 February 26th 09 02:00 AM
Userform Jeff Excel Discussion (Misc queries) 0 February 6th 06 09:30 PM
UserForm 2 Tim Excel Programming 3 February 13th 04 12:12 PM
UserForm John Beaumont Excel Programming 1 December 19th 03 04:41 PM


All times are GMT +1. The time now is 06:44 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"