"> 제목 "> 제목 ">
<head>
  <!-- HTML Meta Tags -->
  <meta charset="UTF-8" />
  <title> 제목 </title>
  <meta
    name="description"   content=" VBA 엑셀탭 숨기기 "   />
  <meta name="keywords" content="VBA, 엑셀VBA, 특정탭 숨기기, 탭 숨기기프로시저, 탭 숨기기 모듈" />

  <!-- Open Graph / Facebook -->
  <meta   property="og:title"   content="VBA 엑셀탭 숨기기 "  />
  <meta  property="og:description" content=" VBA, 엑셀VBA, 특정탭 숨기기, 탭 숨기기프로시저, 탭 숨기기 모듈  "  />
  <meta property="og:image" content="대표 이미지" />
  <meta property="og:url" content="페이지 주소" />
  <meta property="og:type" content="website" />
</head>

<aside> 💡 전체 흐름: 원본파일 넣기 ➡️ 매크로 실행하여 원본파일 숨기기 ➡️ 매크로 전체 비밀번호 설정

</aside>

<aside> 💡

1️⃣구글시트는 원본시트를 숨긴상태에서 공유불가능➡️ 답은 엑셀VBA 2️⃣구글시트는 원본시트를 어찌저찌 숨김채 공유하였더라도, 동시 다발적으로 접속하여 하나의 셀에서 조회하는 것은 불가능 3️⃣ 웹페이지의 DB를 불러오는 형태가 아니라면 VBA사용이 가장 간편

</aside>

1. 첨부파일 다운 후 원본자료 입력 후 기본셋팅

25학년도 OO고 셀프확인핑양식.xlsm

1-1. 첨부파일의 원본보호 탭에 조회할 전체 원본자표 입력

[입력 전]

image.png

[입력 후]

image.png

1-2. 조회기능 VBA

image.png

image.png

2-1. 콤보박스 만들기 VBA

  1. 현재 만들어진 모듈은 총 3개
Option Explicit

'---------------------------------------------
' [1] 원본보호 시트의 이름 목록을 조회 시트의 폼 드롭다운에 채우기
'---------------------------------------------
Sub PopulateNames()
    Dim wsSource As Worksheet, wsLookup As Worksheet
    Dim lastRow As Long, i As Long
    Dim namesArr As Variant
    Dim resultArr() As String, count As Long
    
    Set wsSource = ThisWorkbook.Sheets("원본보호")
    Set wsLookup = ThisWorkbook.Sheets("조회")
    
    lastRow = wsSource.Cells(wsSource.Rows.count, "A").End(xlUp).Row
    If lastRow < 2 Then Exit Sub
    
    namesArr = wsSource.Range("A2:A" & lastRow).Value
    count = 0
    For i = 1 To UBound(namesArr, 1)
        If Trim(namesArr(i, 1)) <> "" Then
            count = count + 1
            ReDim Preserve resultArr(1 To count)
            resultArr(count) = namesArr(i, 1)
        End If
    Next i
    
    ' 폼 드롭다운의 이름이 "드롭다운 5"임
    wsLookup.DropDowns("드롭다운 5").List = resultArr
End Sub

image.png