Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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
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
How can I set up an invoice number system - no form needed VRW Excel Discussion (Misc queries) 0 February 13th 06 08:38 PM
Strange issue freezing parent form when unloading a child form Stefano Gatto Excel Programming 1 November 11th 05 04:42 PM
PO Form Needed Whosyourdata Excel Discussion (Misc queries) 0 September 26th 05 08:45 PM
form window too small - Help needed Liedson31 Excel Programming 2 July 18th 05 02:59 PM
Possible form help needed diverdon99 Excel Programming 1 December 13th 03 12:31 PM


All times are GMT +1. The time now is 02:01 AM.

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"