Welcome to Dream.In.Code
Become a VB Expert!

Join 137,271 VB Programmers for FREE! Get instant access to thousands of VB experts, tutorials, code snippets, and more! There are 1,454 people online right now. Registration is fast and FREE... Join Now!




Help With VBA Listbox reference?

 
Reply to this topicStart new topic

Help With VBA Listbox reference?, trying to pull info from a worksheet by a listbox

asugrl08
26 Nov, 2006 - 09:50 PM
Post #1

New D.I.C Head
*

Joined: 19 Nov, 2006
Posts: 8


My Contributions
I am sorry to be bothering you smile.gif I am trying to say that if the vendor name and the
name on the list box match then the on hand quantity for that vendor in the inventory sheet should be displayed in the on hand quantity cell in the summary sheet

here is my pseudo code:
select inventory wksheet
Count the total number of rows in the inventory sheet
repeat from row#2 to the total number of rows calculated above
If the vendor name for the row(Cell H) is equal to the vendor name in the list box
total_quantity_on_hand=total_quantity_on_hand
+On_Hand_Quantity(Cell D)
End IF
Loop
Select Summary Worksheet
Write the total_quantity_on_hand value to the cell in Summary worksheet

Dim intQuantityOnHand As Integer
Dim intOnHandQuantity As Integer
'Go to inventory worksheet
Worksheets("Inventory").Select
'Count number of rows
'Select cell a1
Worksheets("Inventory").Range("a1").Select
'Select the current region that contains the cell a1
ActiveCell.CurrentRegion.Select
'Count the rows that you selected
intRowCount = Selection.Rows.Count
Worksheets("summary").Select
For i = 0 To 30
If Worksheets("Inventory").Range("H" & i).Value = strVendor _ (intQuantityOnHand) Then
intQuantityOnHand = intQuantityOnHand + intOnHandQuantity
strVendor(intQuantityOnHand) = Worksheets("Inventory").Range("d" & i).Value
End If
Next i
For i = 1 To intVendor
Worksheets("Summary").Select
Next i
User is offlineProfile CardPM
+Quote Post

Fast ReplyReply to this topicStart new topic
Time is now: 12/4/08 08:00PM

Live VB Help!

VB Tutorials

Reference Sheets

VB Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month