Как выделить ячейки, расположенные с определённым интервалом
Категория: Basic
2012-12-01 19:18:53
code: #vba
iFirstRow = 3: iLastRow = 300 For iRow = iFirstRow To iLastRow Step 3 Set iCellOne = Cells(iRow, 1) ' Столбец "A" If iRow = iFirstRow Then Set iCellTwo = Union(iCellOne, iCellOne) Else Set iCellTwo = Union(iCellOne, iCellTwo) End If Next iCellTwo.Select
code: #vba
iFirstRow = 3: iLastRow = 300 For iRow = iFirstRow To iLastRow Step 3 Set iCellOne = Cells(iRow, 1) ' Столбец "A" Set iCellTwo = Union(iCellOne, _ IIf(iRow = iFirstRow, iCellOne, iCellTwo)) Next iCellTwo.Select
code: #vba
iFirstRow = 3: iLastRow = 300 Set iCells = Cells(iFirstRow, 1) ' Столбец "A" For iRow = iFirstRow To iLastRow Step 3 Set iCells = Union(iCells, Cells(iRow, 1)) Next iCells.Select Set iCells = Cells(3, 1) ' Столбец "A" For iRow = 6 To 300 Step 3 Set iCells = Union(iCells, Cells(iRow, 1)) Next iCells.Select
Поделиться: