Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Form Help needed
Hi All, I have a user form with several textboxes. One box has "$Amount". what I am trying to do is when the user click the button after data input, the total from the amount column should appear in dialog box. What could be the script for this? The range will change each time an entry is made. Thank you for your help Syed -- saziz ------------------------------------------------------------------------ saziz's Profile: http://www.excelforum.com/member.php...fo&userid=6350 View this thread: http://www.excelforum.com/showthread...hreadid=478876 |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Form Help needed
Hello Saziz, Could you post your code so it it more clear what you want the code t do? Thanks, Leith Ros -- Leith Ros ----------------------------------------------------------------------- Leith Ross's Profile: http://www.excelforum.com/member.php...fo&userid=1846 View this thread: http://www.excelforum.com/showthread.php?threadid=47887 |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Form Help needed
Hi Leith Ross, here it is: Private Sub CommandButton3_Click() Dim lastrow As Object Dim mysum As Variant Set mysum = Sheet1.Range("g2") Set lastrow = Sheet1.Range("a65536").End(xlUp) lastrow.Offset(1, 0).Value = TextBox1.Text lastrow.Offset(1, 1).Value = TextBox2.Text lastrow.Offset(1, 2).Value = TextBox3.Text lastrow.Offset(1, 3).Value = TextBox4.Text lastrow.Offset(1, 5).Value = TextBox5.Text lastrow.Offset(1, 4).Value = ComboBox1.Value 'MsgBox ("The total untill now is " & mysum) End Sub Originally I wanted it sum column G through code. Col. F has th $amount. All I want is to sum where ever is the last entry in Col. F Now what I did is dedicated a range (G2) for the total of the column F I would still be interested in the systax. Thank you Sye -- sazi ----------------------------------------------------------------------- saziz's Profile: http://www.excelforum.com/member.php...nfo&userid=635 View this thread: http://www.excelforum.com/showthread.php?threadid=47887 |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Form Help needed
Hello Syed, This will sum columns "F" through "I" on the last line entered on the worksheet with the values of the TextBox and CombBox then place the sum in cell "G2". Code: -------------------- Private Sub CommandButton3_Click() Dim lastrow As Long Dim mysum As Variant Set mysum = Sheet1.Range("G2") Set lastrow = Sheet1.Range("A65536").End(xlUp) With Sheet1.Cells(lastrow, "F") MySum = MySum + .Offset(0, 0).Value = TextBox1.Text MySum = MySum + .Offset(0, 1).Value = TextBox2.Text MySum = MySum + .Offset(0, 2).Value = TextBox3.Text MySum = MySum + .Offset(0, 3).Value = TextBox4.Text MySum = MySum + ComboBox1.Value MySum = MySum + TextBox5.Text End with MsgBox ("The total untill now is " & mysum) End Sub -------------------- -- Leith Ross ------------------------------------------------------------------------ Leith Ross's Profile: http://www.excelforum.com/member.php...o&userid=18465 View this thread: http://www.excelforum.com/showthread...hreadid=478876 |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
Form Help needed
Leith Thank you so much for the help. syed -- saziz ------------------------------------------------------------------------ saziz's Profile: http://www.excelforum.com/member.php...fo&userid=6350 View this thread: http://www.excelforum.com/showthread...hreadid=478876 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
How can I set up an invoice number system - no form needed | Excel Discussion (Misc queries) | |||
Strange issue freezing parent form when unloading a child form | Excel Programming | |||
PO Form Needed | Excel Discussion (Misc queries) | |||
form window too small - Help needed | Excel Programming | |||
Possible form help needed | Excel Programming |