Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Excel dropdown to entire column

How to copy a dropdown menu (data validation) to entire column in Excel (only rows that having something else too). And, in this case, how to leave row for the header?

like image 752
lingo Avatar asked Mar 15 '15 11:03

lingo


2 Answers

Instead of clicking in a cell, click on the header (A,B,C, etc) and go to: Data Tools > Data validation.

Example

like image 127
Helder Antunes Avatar answered Sep 21 '22 18:09

Helder Antunes


Ok, I found the answer and now it's working:

Sub pasteCellToColumn()
    Dim lastRow As Long, i As Long

    lastRow = Sheets("Sheet1").Cells(Rows.Count, 2).End(xlUp).Row
    Sheets("hiddenData").Range("A1").Copy

    For i = 1 To lastRow
        If Len(Trim(Sheets("Sheet1").Range("A" & i).Value)) <> 0 Then
        Sheets("Sheet1").Range("K" & i).PasteSpecial _
        Paste:=xlPasteValidation
        End If
    Next i

End Sub
like image 38
lingo Avatar answered Sep 22 '22 18:09

lingo