Excel下拉至整列 [英] Excel dropdown to entire column
本文介绍了Excel下拉至整列的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何将下拉菜单(数据验证)复制到Excel中的整个列(仅包含其他内容的行)。而且,在这种情况下,如何为标题保留行?
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?
推荐答案
好,我找到了答案,现在可以了:
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
这篇关于Excel下拉至整列的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文