매크로/모듈(Module) 37

입력 모드를 영문(알파벳)으로 설정

한영 전환, 입력 모드 반환 사용자 정의 함수Chat-GPT o4-mini-high 버전을 이용해 생성한 코드다. 한글/영문 입력 모드를 반환하거나, 영문 모드, 한글 모드, 영문은 한글로, 한글은 영문으로 토글하는 코...cafe.naver.comOption Explicit#If VBA7 Then Private Declare PtrSafe Function GetForegroundWindow Lib "user32" () As LongPtr Private Declare PtrSafe Function ImmGetContext Lib "imm32.dll" (ByVal hWnd As LongPtr) As LongPtr Private Declare PtrSafe Function ImmRele..

선택시트를 지정 폴더에 시트 결합 PDF 출판

Option Explicit Sub Total_Publish_To_Pdf()  '★★결합PDF저장★★  'PDF FILE 저장 POLDER 지정   Dim strPolderName As String  '확장자를 포함한 워크북명   Dim LATUS As String  '확장자를 제거한 워크북명   Dim strFileName As String   Dim iSplit As Integer   Dim sht As Worksheet   Dim vAry() As Integer   Dim ShtAry() As String   Dim i As Integer   Dim n As Integer        'PDF 출판 폴더를 지정   With Application.FileDialog(msoFileDialogFolder..

선택시트를 지정 폴더에 시트 단위로 PDF 출판

Option Explicit Sub Publish_To_Pdf()  '★★개별PDF저장★★  'PDF FILE 저장 POLDER 지정   Dim strPolderName As String  '확장자를 포함한 워크북명   Dim LATUS As String  '확장자를 제거한 워크북명   Dim strFileName As String   Dim iSplit As Integer   Dim sht As Worksheet   Dim vAry() As Integer   Dim ShtAry() As String   Dim i As Integer   Dim n As Integer        'PDF 출판 폴더를 지정   With Application.FileDialog(msoFileDialogFolderPicker..

클립보드의 사진을 시트에 붙이기

Option Explicit Option Base 1 #If VBA7 Then     Declare PtrSafe Function OpenClipboard Lib "user32" (ByVal hwnd As LongPtr) As Long     Declare PtrSafe Function CloseClipboard Lib "user32" () As Long     Declare PtrSafe Function EmptyClipboard Lib "user32" () As Long #Else     Declare Function OpenClipboard Lib "user32" (ByVal hwnd As LongPtr) As Long     Declare Function CloseClipboard Lib "use..

TreeView Control(Ⅲ)

참조 : https://www.homeandlearn.org/introduction_to_treeviews.html A. TreeViw Control 추가 1. TreeView 추가 컨트롤 2. 도구상자 TreeView 컨트롤 추가 3. UserForm에 TreeView 컨트롤 추가 4. TreeView 컨트롤 속성 변경 B. 트리뷰에 상위 노드를 추가하려면 구문은 다음과 같으며, Dim node As node Set node = TreeView.Nodes.Add ( [Relative], [Relationship], [Key], [Text], [Image], [SelectedImage] ) as Node = 트리뷰오브젝트.Nodes.Add ( 상대, 관계, 키, 텍스트, 이미지, 선택된이미지 ) 1. 트..

Import the file to the sheet

Private Sub ImportTheFiletoTheSheet() On Error Resume Next Dim Files As Variant Dim fileX As Variant Dim sht As Worksheet Dim WB As Workbook Dim rngTarget As Range '화면 업데이트 일시 중지 Application.ScreenUpdating = False '시트삽입 후 시트이름 지정 Worksheets.Add(After:=Worksheets(Worksheets.Count)).Name = "Importthefiletothesheet_" '여러개 파일이 선택가능하도록 multiselect속성을 '참'으로 한다 Files = Application.GetOpenFilename(filef..

Export Range to File...

Option Explicit Sub ExportRangetoFile() Dim TitleId As String Dim WorkRng As Range Dim xFile As Variant Dim xFileString As String On Error Resume Next '화면 업데이트(일시) 정지 Application.ScreenUpdating = False TitleId = "Export Range to File...." Set WorkRng = Application.Selection Set WorkRng = Application.InputBox("Seltion Range", TitleId, WorkRng.Address, Type:=8) '현재시트를 새워크북에 복사 Application.ActiveSh..

LIST