Диапазон не будет определять

Обычно я делаю общую фильтрацию по строкам следующим образом:

criterion = lambda row: row['countries'] not in countries
not_in = df[df.apply(criterion, axis=1)]
1
задан Alexandra Thayer 13 July 2018 в 22:20
поделиться

2 ответа

Циклы медленны. Матч быстрый, и последняя заполненная ячейка может быть легко расположена снизу вверх.

dim aio as variant, keyCells As Range

with worksheets("sheet1")
    aio = application.match("Added Info/Options", .columns(5), 0)
    if not iserror(aio) then
        set keyCells = .range(.cells(aio+1, "E"), .cells(.rows.count, "D").end(xlup).offset(0, 1))
    else
        debug.print "Added Info/Options not found"
    end if
end with
0
ответ дан Jeeped 17 August 2018 в 12:07
поделиться
Dim f As Range, KeyCells As Range

With ActiveSheet

    Set f = .Rows(5).Find(What:="Added Info/Options", lookat:=xlWhole)
    If Not f Is Nothing Then
        Set f = f.Offset(1, -1)
        Set KeyCells = .Range(f, .Cells(.Rows.Count, f.Column).End(xlUp))
    Else
        Msgbox "Required header not found!"
    End If

End With
0
ответ дан Tim Williams 17 August 2018 в 12:07
поделиться
Другие вопросы по тегам:

Похожие вопросы: