Rita Figueira
Rita Figueira

Reputation: 9

Copy specific cell to a specific column

Cell E8 and E6 are dependent dropdown lists and they are working.

The range of this dependent dropdown list comes from columns K to M.

enter image description here

Now I want to add automatically more names do my dependent dropdown list.

Upvotes: 0

Views: 56

Answers (1)

Peter
Peter

Reputation: 11

Private Sub Move()
Dim row, column As Integer
Dim ws As Worksheet
Set ws = ActiveSheet

'Determine Column
Select Case ws.Cells(8, 5).Value

    Case "Equipment"
        column = 11
    Case "Tool"
        column = 12
    Case "Car"
        column = 13

End Select

If column = 0 Then
    Exit Sub
End If

'Determine row
row = ws.Cells(Rows.Count, column).End(xlUp).row + 1

'Put value in cell
ws.Cells(row, column).Value = ws.Cells(6, 5).Value

End Sub

Upvotes: 1

Related Questions