Loop function

arunsjain

Board Regular
Joined
Apr 29, 2016
Messages
130
Office Version
  1. 365
Platform
  1. Windows
Hi

I got list in one table which contains three columns (Customer, Product and Type). On the other sheet I got drop down list.

I am looking for a macro through which each row data populate in drop down list one by one. Like S.No.1 will populate in dropdown list then S.No. 2 will populate and then next until end of the table. Could anyone help please?

List
S.No.
Customer
Product
Type
Description
Drop down list
1
A
Apple
Medium
Customer
A
2
A
Banana
Large
Product
Apple
3
B
Orange
Small
Type
Medium
4
B
Pears
Small
5
D
Fish
Small
6
E
Crab
Medium
7
G
Chicken
Medium

<tbody>
</tbody>


Appreciate your help.

Kind Regards
Arun
 

Excel Facts

Test for Multiple Conditions in IF?
Use AND(test, test, test, test) or OR(test, test, test, ...) as the logical_test argument of IF.
Cross-posted here: https://www.excelforum.com/excel-programming-vba-macros/1213105-loop-function.html

While we do not prohibit Cross-Posting on this site, we do ask that you please mention you are doing so and provide links in each of the threads pointing to the other thread (see rule 13 here along with the explanation: Forum Rules). This way, other members can see what has already been done in regards to a question, and do not waste time working on a question that may already be answered (especially since you claim it has been solved, but did not update this thread!)
 
Upvote 0
try:

Code:
Private Sub LoadCbo()
Dim c As Integer

Range("A2").Select
With cboBox
  While ActiveCell.Value <> ""
       For c = 1 To 3
          .AddItem ActiveCell(0, c).Value
       Next
       
     ActiveCell.Offset(1, 0).Select   'next row
  Wend
End With
End Sub
 
Last edited:
Upvote 0

Forum statistics

Threads
1,215,348
Messages
6,124,425
Members
449,157
Latest member
mytux

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top