본문 바로가기

Excel&VBA15

VBA) 그룹 자동화 그룹 dim idx_1 as long dim idx_2 as long dim sRow as long dim LastRow as long dim TargetSheet as Worksheet set TargetSheet = Sheets("쉬트명") TargetSheet.Select --처리행 구하기 LastRow = TargetSheet.Range("a65536").End(xlUp).Row Application.ScreenUpdating = False With ActiveSheet.Outline .AutomaticStyles = false .SummaryRow = xlAbove .SummaryColumn = xlRight End With For idx_1 = 2 To LastRow If cells(idx_1.. 2022. 10. 7.
VBA) 전각문자 치환 Public Function WideReplace(Source as string) as string Dim iStart as Integer Dim Target as String Dim sTemp as String For iStart = 1 To Len(Source) sTemp = Mid(Source, iStart, 1) '전각을 반각으로 변환 후 합침 Target = Target & StrConv(sTemp, vbNarrow) Next iStart WideReplace = Target End Function 2022. 7. 18.
"셀 서식"으로 요일 표시 1. 날짜 셀을 모두 선택 2. 마우스 오른쪽 클릭 후 "셀 서식"을 선택하고 다음 대화 상자에서 "형식" -> "사용자 정의"를 선택 3. 그런 다음 "yy-mm-dd(aaa)"를 추가로 입력 ddd : 영문, aaa : 한글 결과 : 22-03-08(월) 2022. 3. 8.
WBS일정 주별 자동 색상표시 WBS에서 주별 색상 자동 표시 1. 수식 1) 규칙 : 수식을 사용하여 서식을 지정할 셀 결정 =AND(해당주 >= 시작일자, 해당주 2021. 12. 28.
VBA) 파일 리스트 추출하기 기능을 제대로 사용하기 위해서는 먼저 도구 → 참조 → "Microsoft Scripting Runtime"을 체크 → 확인 버튼을 눌러서 사용할 수 있게 호출 Dim Row As Integer Sub FList_MST() Dim F_Dlg As FileDialog Dim FS As Scripting.FileSystemObject Dim F_Info As Folder Set F_Dlg = Application.FileDialog(msoFileDialogFolderPicker) F_Dlg.Show Row = 2 Set FS = New Scripting.FileSystemObject Set F_Info = FS.GetFolder(F_Dlg.SelectedItems(1)) Call Folder_List(F_I.. 2021. 10. 19.
VBA) 데이터 전체 행/열 구하기 Dim sht As Worksheet Set sht = ActiveWorkbook.sheets ("매핑생성") '필터해제 If sht.FilterMode = True Then sht.ShowAllData End If 1) rowcnt = sht.Range("b65536").End(xlUp).Row colcnt = sht.Rnage("A1").End(xlToRight).Column 2) With sht.UsedRange rowcnt = .Rows.Count colcnt = .Columns.Count End With 2021. 4. 6.
[VB] Shell로 실행파일 실행후 끝날때까지 대기 Option Explicit  '메인 프로세스 오브젝트 핸들링 Private Declare Function OpenProcess Lib "kernel32" _ (ByVal dwDesiredAccess As Long, ByVal bInheritHandle As Long, _ ByVal dwProcessId As Long) As Long '지정한 프로세스 오브젝트 핸들링 Private Declare Function GetExitCodeProcess Lib "kernel32" _ (ByVal hProcess As Long, .. 2019. 3. 6.
[VBA] 문자 분리하기(split) dim temp dim i as integer dim icnt as integer temp = "123,456,789" rem 구분자로 배열 수 확인 icnt = UBound(Split(temp,",")) for i = 0 to icnt debug.print Split(temp, ",")(i) next i 2018. 2. 13.
[VBA] 폴더 선택하기 Dim sPath as String Dim fileName as String Dim ll_idx as integer Sheets("접속정보").Select '기존 데이터 삭제 Rance("C2").ClearContents Range("처리목록","C1000").ClearContents '초기 선택 폴더 With Application.FileDialog(msoFileDialogFolerPicker) .InitialFileName = sInitPath .Title = "폴더를 선택하.. 2018. 2. 6.
[VBA] 파일 다중 선택하기 Dim fileName as String Dim ll_idx as integer '기존 데이터 삭제 Rance("C2").ClearContents Range("처리목록","C1000").ClearContents '초기 선택 폴더 With Application.FileDialog(msoFileDialogFilePicker) .InitialFileName = sInitPath .Title = "파일을 선택하세요" .AllowMultiSelect = True .Filters.Clear .Filters.. 2018. 2. 6.
엑셀 다중창 사용 [OFFICE] excel 다중창 사용 오늘은 office 의 가장 많이 쓰이는 excel 을 다중창으로 열어 봅시다. 한가지 팁이죠.~ 우훗 - 워드나 이런건 여러개가 열리는데 엑셀은 하나밖에 안열린다며 씨불씨불 거리지 말고, 셋팅을 해 봅시다 ^^ 1. "시작 내컴퓨터 > 도구 > 폴더옵션 > 파일형식 " 을 선택.. 2013. 11. 4.
[VBA] CLOB 형식으로 저장하기 Function map_tab_bigo(strSysID As String) Dim DbCon As ADODB.Connection Dim DbCmd As ADODB.Command Dim DbCmd2 As ADODB.Command Dim DbCmd3 As ADODB.Command Dim strDir As String Dim strFile As String Dim msg As String Dim sht As Worksheet Dim myWorksheet As Worksheet Dim myActivesheet As Worksheet Dim strDirList(3) As String Dim no, Rowcnt As Integer Dim idx_1, idx_2, idx_3, idx.. 2013. 8. 6.