VBA to create a drop-down list of say, red, green, blue.

jkalpus

New Member
Joined
Apr 17, 2004
Messages
46
Here's the details: Let's say I have a drop down list in 1400 rows of column Q. The drop-down list is populated by a named range, COLORS. I was a drop-down list in every cell of the 1400 rows of Col Q. Easy enough. Here's the rub: The first item in the drop-down list is RED. If a user selects RED in A1, A3, A5, etc. (all the odd-numbered rows) then I want A2, A4, A6, etc. (all the even numbered rows) to be equal to the odd-numbered row above.

To recap, I want a drop-down list in all 1400 rows of col Q, and I also want the even-numbered rows to echo the row above if a user select the first item in the drop-down list, RED. Even IF they select RED in A1, for example, i STILL want/need a drop-down list in A2, A4, etc.


Thanks in advance! jk
 

Excel Facts

How can you automate Excel?
Press Alt+F11 from Windows Excel to open the Visual Basic for Applications (VBA) editor.
Only VBA can do what you want
- the cell value can either be the resut of a formula or the result of selection (from dropdown) but not both

Need more info:
When user selects "RED" Q1 is it only Q2 that changes to RED"?
- if not which other cells changes

If Q1 and Q2 both contain "RED" and user selects "BLUE" in A3 is it only A4 that changes to "RED"?
- if not which other cells changes

If Q2 is already "RED" (because Q1 is RED) what happens if user selects "BLUE" in Q2

Please be precise
 
Upvote 0
If I understand you correctly, try
Code:
Private Sub Worksheet_Change(ByVal Target As Range)
   If Target.CountLarge > 1 Then Exit Sub
Application.EnableEvents = False
   If Target.Column = 17 And Application.IsOdd(Target.Row) Then
      Target.Offset(1).Value = Target.Value
   End If
Application.EnableEvents = True
End Sub
This needs to go in the sheet module.
Whenever you change col Q on an odd numbered row the cell below will mirror that value
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,183
Members
453,020
Latest member
Mohamed Magdi Tawfiq Emam

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