'SpecialCells'에 해당되는 글 1건

  1. 2014.11.19 SpecialCells Error ...



엑셀의 셀 선택시에 사용하는  SpecialCells


MyRange.SpecialCells(xlCellTypeFormulas) 이거나

MyRange.SpecialCells(xlCellTypeConstants) 인 경우


SpecialCells  의 결과가 8192 가 넘으면 올바로 잡지를 못합니다 - 통으로 하나로 보게됩니다-


아래 코드는 8192 셀을 선택하게끔 되어있는데

이를 8193 으로 하고 돌리면 C 열 통으로 잡습니다

AREAS.COUNT 가 2^13 을 넘으면 포기하는 듯...

주의를 요합니다.


SpecialCells SELECTION ERROR ~

After Selected SpecialCells.areas > 8192 then cannot select SpecialCells  

if cntRR = 8193

and Run thiscode...SpecialCells select  ==>  Column "C" should selected...


Option Explicit

Sub SpecialCells_Test()' === 모듈 시작
' CodeBy [ 오즈맨 ] , Date : 2014-11-19

Dim MyRange   As Range
Dim MyyRange  As Range

Dim i     As Double
Dim cntRR As Double

cntRR = 8192

Set MyRange = Range("C:C")
MyRange.Clear
For i = 1 To cntRR
     Range("C" & i * 2).Value = Rnd
Next
Set MyyRange = MyRange.SpecialCells(xlCellTypeConstants)

MyyRange.Interior.ColorIndex = 15
Debug.Print MyyRange.Areas.Count, cntRR

End Sub         ' ___ 모듈 종료

Posted by 오즈맨스머프