'엑셀'에 해당되는 글 1

  1. 2012.10.30 엑셀(Excel VBA) - 필터링 된 시트에서 선택된 셀 얻기

엑셀(Excel VBA) - 필터링 된 시트에서 선택된 셀 얻기

자동필터(Autofilter) 된 시트(sheet)에서 
컨트롤키(Ctrl) 로 여러 칸(Cell)을 선택한 다음
고른 칸 마다 myFunc 를 실행하려면 다음과 같이 하면 된다. 

For Each area In Selection.Areas
    If area.Count = 1 Then
        myFunc (area.Item(1))
    Else
        Set vCells= area.SpecialCells(xlCellTypeVisible)
        For Each cell In vCells
            myFunc (cell.Item(1))
        Next cell
    End If
Next area



.