Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Looping through text boxes


Thanks. If you were wondering, I was trying to use the a and b a
index numbers to reference a specific cell. Just because you wer
curious, I have 13 pairs of cells and 13 text boxes. Each text bo
corresponds with a pair of cells. Each of the pairs of cells will hav
three possible configurations. 1: Both are "n/a" 2: The first is
number and the second is "n/a", or 3: Both are numbers.
Here are three examples of what I want it to do.
Cells H3, and I3 contain "n/a", when I click "Calculate" text box t
will get "n/a"
Cell H4 contains a 15, and Cell I4 contains "n/a", t2 will get "15"
Cell H5 contains a 15, and Cell I5 contains a 15, t3 will get "15,15"

My problem with it was that I know how to increment the cell inde
numbers to reference the next set of cells, but I don't know how t
name the text box so that I can increment it corresponding to th
incremented cell pair(if any of that makes sense. Thanks for the help
Ill try it out and see if I can figure something out

--
skrimp
-----------------------------------------------------------------------
skrimpy's Profile: http://www.excelforum.com/member.php...fo&userid=1463
View this thread: http://www.excelforum.com/showthread.php?threadid=26346

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Looping through text boxes

Assume the first cell is in row 3

Private sub CommandButton1_click()
for i = 3 to 15
if cells(i,8).Value = "n/a" and cells(i,9).Value = "n/a" then
Userform1.Controls("t" & i - 2).Value = "n/a"
elseif cells(i,8).Value < "n/a" and cells(i,9).Value < "n/a" then
Userform1.Controls("t" & i - 2).Value = cells(i,8).Value & ", " & _
cells(i,9).Value
elseif cells(i,8).Value < "n/a" then
Userform1.controls("t" & i - 2).Value = cells(i,8).Value
end if
Next i
End sub

name the textboxes t1 to t13

--
Regards,
Tom Ogilvy


"skrimpy" wrote in message
...

Thanks. If you were wondering, I was trying to use the a and b as
index numbers to reference a specific cell. Just because you were
curious, I have 13 pairs of cells and 13 text boxes. Each text box
corresponds with a pair of cells. Each of the pairs of cells will have
three possible configurations. 1: Both are "n/a" 2: The first is a
number and the second is "n/a", or 3: Both are numbers.
Here are three examples of what I want it to do.
Cells H3, and I3 contain "n/a", when I click "Calculate" text box t1
will get "n/a"
Cell H4 contains a 15, and Cell I4 contains "n/a", t2 will get "15"
Cell H5 contains a 15, and Cell I5 contains a 15, t3 will get "15,15"

My problem with it was that I know how to increment the cell index
numbers to reference the next set of cells, but I don't know how to
name the text box so that I can increment it corresponding to the
incremented cell pair(if any of that makes sense. Thanks for the help.
Ill try it out and see if I can figure something out.


--
skrimpy
------------------------------------------------------------------------
skrimpy's Profile:

http://www.excelforum.com/member.php...o&userid=14634
View this thread: http://www.excelforum.com/showthread...hreadid=263461



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
User Form Text Boxes - Copy format of text boxes NDBC Excel Discussion (Misc queries) 3 July 2nd 09 02:02 AM
Looping through text boxes skrimpy[_3_] Excel Programming 1 September 25th 04 04:42 PM
Looping Text Bob Myles Excel Programming 4 April 25th 04 04:36 AM
looping through text boxes Ian Mangelsdorf Excel Programming 1 January 20th 04 06:11 AM
Looping through Text boxes Fred[_9_] Excel Programming 0 July 9th 03 03:06 AM


All times are GMT +1. The time now is 05:18 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"