본문 바로가기
반응형

Excel VBA8

자동 필터 후 자동필터 목록에 있는 데이터 개수 구하기 Sub CountUniqueFilteredValues() Dim rng As Range Dim dict As Object Dim cell As Range Dim uniqueCount As Long Dim ws As Worksheet ' 현재 활성 워크시트 설정 Set ws = ActiveSheet ' 범위 설정 Set rng = ws.Range("A2").CurrentRegion ' 자동 필터 모드 확인 If Not ws.AutoFilterMode Then MsgBox "자동 필터가 적용되어 있지 않습니다. 먼저 필터를 적용해 주세요.", vbInformation Exit Sub Else End If ' .. 2024. 7. 11.
데이터 요약하기 Sub MergeProductDataWithFormatting() Dim x, i As Long, P As Long, k As Long, n As Long Dim ws As Worksheet Set ws = Sheets("Product") With ws.Range("a1").CurrentRegion x = .Value With CreateObject("Scripting.Dictionary") .Comparemode = 1 For i = 1 To UBound(x) If .Exists(x(i, 1)) Then n = .Item(x(i, 1)) x(.Item(x(i, 1)), 2) = x(.Item(x(i, 1)), 2) + x(i, 2) x(.Item(x(i, 1)), 3) = x(.Item(x(i, 1)).. 2023. 8. 12.
QBColor 지정된 색상 번호에 해당하는 RGB 색상 코드를 나타내는 Long 을 반환합니다 . QBColor function (Visual Basic for Applications) Office VBA reference topic learn.microsoft.com 구문은 다음과 같습니다. Syntax QBColor(color) 0~15까지의 정수입니다. 다른 내장 상수와 비교하면 다음과 같습니다. 도움말을 번역한 내용입니다. color 인자는 이전 버전의 Basic(예: MS-DOS용 Microsoft Visual Basic 및 기본 컴파일러)에서 사용하는 색상 값을 나타냅니다. 최하위 바이트부터 시작하여 반환되는 값은 Visual Basic for Applications에서 사용하는 RGB 시스템에서 적절한 색.. 2023. 7. 19.
XlRgbColor XlRgbColor enumeration은 RGB색상값을 정의하는 상수입니다. XlRgbColor enumeration (Excel) Office VBA reference topic learn.microsoft.com XlRgbColor 열거형 값은 모두 142개가 있습니다. 예제 코드 Sub ChangeFontColors() Range("A1").Font.Color = rgbBlue Range("A2").Font.Color = rgbCrimson Range("A3").Font.Color = rgbDarkOrange Range("A4").Font.Color = rgbIndigo End Sub Sub ChangeCellColors() Range("A1").Interior.Color = rgbGreen Ra.. 2023. 7. 18.
반응형