Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Help with vba coding/userform....
Hi guys,
Hate to post this again but I still need help on a vba userform. Here's what I have so far thanks to Bob Phillips. :) I have modifie the programming that he is helping me with. This is what I have s far: Private Sub CommandButton1_Click() IncDec txt1Add, True IncDec txt1Subtract, true End Sub Private Sub IncDec(textbox As msforms.textbox, Increment As Boolean) Dim iItem As Long iItem = Evaluate("Match(" & txt1Add.Text & ",A1, 0)") If iItem Then If Increment Then Cells(2, 1).Value = Cells(2, 1).Value + 1 End If End If End Sub Private Sub CommandButton2_Click() End End Sub Private Sub UserForm_Click() End Sub ______________________________________________ Here's part of my layout on my spreed sheet: A1 has 1001.01 B1 has 1001.02 C1 has 1001.03 A2 has 10 B2 has 10 C2 has 10 What I'm trying to do is create a userform with inputboxes that wil allow 1001.01(A1) to update 10(A2). The form has will have 7 boxe under the word Add on the userform and 7 boxes under the word Subtract I would like to be able to input 1001.01 in any of the add boxe inorder to update A2. And also be able to type in 1001.02 in any o the Add boxes and update only B2. These ("1001.01") type of number represent section numbers and the 10 numbers or any number in colum two will represent amounts. I could have all the section numbers i column A and all the updatable quantity numbers in column B. Is ther a way in order to this to work? Is there a way of using Match item i column A and update corresponding cell in column b by "1". If section number is enter in an inputbox on the userforum under th subtract column, then the opposite effect would happen. Th corresponding cell would decrease. With this part of the program I modified: iItem = Evaluate("Match(" & txt1Add.Text & ",A1, 0)") If iItem Then If Increment Then Cells(2, 1).Value = Cells(2, 1).Value + 1 When I put "1001.01" in the txt1Add input box, the Cell A2 gets update by 1. I added the following, but got a debugging error: iItem = Evaluate("Match(" & txt1subtract.text & ",A1, 0)") If iItem Then If Increment Then Cells(2, 1).Value = Cells(2, 1).Value + 1 Is there a way to have it as such: (for the add boxes) List: If 1001.01(A1) then add 1 to b1 If 1001.02(A2) then add 1 to b2 If 1001.03(A3) the add 1 to b3 ect...? (for the subtract boxes) List: If 1001.01(A1) then subtract 1 from b1 etc....? Any help is appreciated! marty -- Message posted from http://www.ExcelForum.com |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
How to fix the coding? | Excel Worksheet Functions | |||
Coding | Excel Discussion (Misc queries) | |||
Userform inside another userform | Excel Programming | |||
API coding | Excel Programming | |||
Help coding userform | Excel Programming |