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 Tom. It works great. Is the way that I was doing thi
incorrect? I was under the impression that it was best to us
variables where ever possible.

Tom Ogilvy Wrote:
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 Ogilv


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

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[_4_] Excel Programming 1 September 26th 04 03:06 AM
Looping through text boxes skrimpy[_3_] Excel Programming 1 September 25th 04 04:42 PM
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:07 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"