<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>
[입력 전]
[입력 후]
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
성공적으로 진행되고 있다면 콤보박스를 눌렀을 때 아래 그림처럼 목록이 보여야 함