Hello,
I am trying to get this vba code to work so that when a options is selected for the zone 1 drop down menu for instance if plank is selected itll put those rooms with a quantity on the plank page but if sheet vinyl is selected itl do the same thing. I just cant seem to get the code to work :/ ..... this is the code that i have and the attached workbook
Private Sub Worksheet_Change(ByVal Target As Range)
Dim ws1 As Worksheet, ws2 As Worksheet
Dim rng As Range
Application.EnableEvents = False
If Not Intersect(Target, Range("H14:H18")) Is Nothing Then
Set ws1 = Worksheets("DEF_ZONES") ' tables of Rooms per Zone
Set ws2 = Worksheets(Target.Value) ' Product type e.g "Sheet Vinyl"
zone = Replace(Target.Offset(0, -1), " ", "_") ' Named Range of Zones
Set rng = ws1.Range(zone)
With ws2
irow = 14
Do While .Cells(irow, 2) <> "" ' find second blank cell
irow = irow + 1
Loop
For Each c In rng
.Cells(irow, 2) = c
irow = irow + 1
Next c
End With
End If
Application.EnableEvents = True
End Sub
Bookmarks