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

I was wondering if it was possible to populate textboxes with a counte
value. I need to search through a column to find an ordernumber an
then populate a number of textboxes depending on how many times tha
order number matches.

Dim OrderNum As Variant
Dim Qty As Variant
Dim ItemId As Variant
Dim ItemDes As Variant

OrderNum = shtOrder.Range("B2:B100").Value
OrderNum = shtOrder.Application.WorksheetFunction.Transpose(O rderNum)

Qty = shtOrder.Range("F2:F100").Value
Qty = shtOrder.Application.WorksheetFunction.Transpose(Q ty)

ItemId = shtOrder.Range("G2:G100").Value
ItemId = shtOrder.Application.WorksheetFunction.Transpose(I temId)

ItemDes = shtOrder.Range("H2:H100").Value
ItemDes = shtOrder.Application.WorksheetFunction.Transpose(I temDes)

Dim Counter As Integer
Counter = 1

For i = 1 To UBound(OrderNum)
If OrderNum(i) = purchase.Value Then
txtQty(Counter).Value = Qty(i)
txtItem(Counter).Value = ItemId(i)
txtDes(Counter).Value = ItemDes(i)
Counter = Counter + 1
End If
Next i

'It gives my an error when i use the counter variable

thank

--
Message posted from http://www.ExcelForum.com

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default textbox counter probelm

Textboxes on a Userform:

Counter = 1
For i = 1 To UBound(OrderNum)
If OrderNum(i) = purchase.Value Then
me.controls("txtQty" & Counter).Value = Qty(i)
me.Controls("txtItem" & Counter).Value = ItemId(i)
me.controls("txtDes" & Counter).Value = ItemDes(i)
Counter = Counter + 1
End If
Next i

Assumes the textboxes are name
txtqty1 txtitem1 txtdes1
txtqty2 txtitem2 txtdes2
etc.

--
Regards,
Tom Ogilvy

"l1075 " wrote in message
...
I was wondering if it was possible to populate textboxes with a counter
value. I need to search through a column to find an ordernumber and
then populate a number of textboxes depending on how many times that
order number matches.

Dim OrderNum As Variant
Dim Qty As Variant
Dim ItemId As Variant
Dim ItemDes As Variant

OrderNum = shtOrder.Range("B2:B100").Value
OrderNum = shtOrder.Application.WorksheetFunction.Transpose(O rderNum)

Qty = shtOrder.Range("F2:F100").Value
Qty = shtOrder.Application.WorksheetFunction.Transpose(Q ty)

ItemId = shtOrder.Range("G2:G100").Value
ItemId = shtOrder.Application.WorksheetFunction.Transpose(I temId)

ItemDes = shtOrder.Range("H2:H100").Value
ItemDes = shtOrder.Application.WorksheetFunction.Transpose(I temDes)

Dim Counter As Integer
Counter = 1

For i = 1 To UBound(OrderNum)
If OrderNum(i) = purchase.Value Then
txtQty(Counter).Value = Qty(i)
txtItem(Counter).Value = ItemId(i)
txtDes(Counter).Value = ItemDes(i)
Counter = Counter + 1
End If
Next i

'It gives my an error when i use the counter variable

thanks


---
Message posted from http://www.ExcelForum.com/



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default textbox counter probelm

Works Great
Thank

--
Message posted from http://www.ExcelForum.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
Probelm with macro mac Excel Worksheet Functions 5 January 14th 08 07:47 PM
AV probelm with Office 2007 John Excel Discussion (Misc queries) 2 October 6th 06 09:37 PM
Hyperlink probelm Glenn Richardson Excel Worksheet Functions 2 August 30th 05 02:26 PM
Hyperlink probelm Glenn Richardson Excel Discussion (Misc queries) 1 August 30th 05 01:44 PM
Probelm with Data formatting amit[_2_] Excel Programming 1 September 11th 03 09:39 AM


All times are GMT +1. The time now is 12:38 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"