Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 54
Default Textbox Query

I have a userform which transfers data from 119 textbox's to my worksheet.
What I need to do is have a tally of all totals over 100 in these boxes and
place in cell "h14" on worksheet tally. Can this be done?

Thanks

Greg


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,339
Default Textbox Query

Try these. I wasn't sure whether tally was sum of values or simply count of
textboxes (100). If the latter, change to "tot=tot+1".

Dim i As Integer, tot As Integer
tot = 0
With UserForm1
For i = 1 To 119 'Assumes texboxes are textbox1, textbox2 etc
If Val(.Controls("textbox" & i).Value) 100 Then
tot = tot + Val(.Controls("textbox" & i).Value)
tot=tot+1 ' ????
End If
Next i
MsgBox tot
End With


OR

Dim i As Integer, tot As Integer, b As Object
tot = 0
For Each b In UserForm1.Controls ' any textbox name
If TypeName(b) = "TextBox" Then
If Val(b.Value) 100 Then
tot = tot + Val(b.Value)
tot=tot+1 ' ????
End If
End If
Next b

MsgBox tot

HTH

"Greg B" wrote:

I have a userform which transfers data from 119 textbox's to my worksheet.
What I need to do is have a tally of all totals over 100 in these boxes and
place in cell "h14" on worksheet tally. Can this be done?

Thanks

Greg



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Textbox Query



Thanks for that,

Greg

*** Sent via Developersdex http://www.developersdex.com ***
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
textbox query Greg B Excel Discussion (Misc queries) 2 June 3rd 05 02:25 PM
Textbox Query Greg[_20_] Excel Programming 5 March 31st 05 06:59 PM
Web Query - UserID/Password Protected Textbox tholt2 Excel Programming 0 June 29th 04 04:28 AM
textbox query libby Excel Programming 0 January 13th 04 06:03 PM
textbox query libby Excel Programming 2 August 2nd 03 04:10 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"