Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Populating TextBox Value--using ListBox

Please forgive my nescience.

I am trying to now populate a value into a textbox based on th
selection of Listboxes (thanks Tom and Bob!). With this value I wil
then do math, but that is the easy part. I cannot get the value t
populate into the textbox "tbGrossFreight". Any help would b
appreciated. My current code is below.


Sub GrossFreight()
Dim Row As Integer
Set testWholesaler = ThisWorkbook.Sheets("lookup on brewery no
refrig")
TopicCount
Application.WorksheetFunction.CountA(testWholesale r.Range("A:A"))


For Row = 1 To TopicCount
If testWholesaler.Cells(Row, 3) = cbWholesaler.Value Then
If cbBrewery.Value = testWholesaler.Cells(Row, 7) Then
tbGrossFreight.Value = testWholesaler.Cells(Row, 13)
End If
End If
Next Row

End Su

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

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Populating TextBox Value--using ListBox

Your code should work and the textbox should be populated if the two
screening conditions are met.

If it isn't working I suspect no row passes both tests.

--
Regards,
Tom Ogilvy



"jpendegraft " wrote in message
...
Please forgive my nescience.

I am trying to now populate a value into a textbox based on the
selection of Listboxes (thanks Tom and Bob!). With this value I will
then do math, but that is the easy part. I cannot get the value to
populate into the textbox "tbGrossFreight". Any help would be
appreciated. My current code is below.


Sub GrossFreight()
Dim Row As Integer
Set testWholesaler = ThisWorkbook.Sheets("lookup on brewery non
refrig")
TopicCount =
Application.WorksheetFunction.CountA(testWholesale r.Range("A:A"))


For Row = 1 To TopicCount
If testWholesaler.Cells(Row, 3) = cbWholesaler.Value Then
If cbBrewery.Value = testWholesaler.Cells(Row, 7) Then
tbGrossFreight.Value = testWholesaler.Cells(Row, 13)
End If
End If
Next Row

End Sub


---
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
Populating listbox Mick[_2_] Excel Discussion (Misc queries) 1 May 14th 08 10:48 PM
populating a multi-column Listbox Tom Ogilvy Excel Programming 3 April 26th 04 08:26 PM
Populating a userform 3 col listbox Martin[_13_] Excel Programming 0 April 19th 04 09:49 PM
populating multicolumn listbox with an array instead of... notsureofthatinfo Excel Programming 0 November 5th 03 10:18 PM
Populating Textbox in UserForm Derek[_2_] Excel Programming 3 July 10th 03 10:41 PM


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