728x90
    
    
  엑셀파일에서 Alt+F11 누르고 우클릭-삽입-모듈

모듈에 코드 입력 후
Sub CSVFile()
'updateby Extendoffice
    Dim xRg As Range
    Dim xRow As Range
    Dim xCell As Range
    Dim xStr As String
    Dim xSep As String
    Dim xTxt As String
    Dim xName As Variant
    On Error Resume Next
    If ActiveWindow.RangeSelection.Count > 1 Then
      xTxt = ActiveWindow.RangeSelection.AddressLocal
    Else
      xTxt = ActiveSheet.UsedRange.AddressLocal
    End If
    Set xRg = Application.InputBox("Please select the data range:", "Kutools for Excel", xTxt, , , , , 8)
    If xRg Is Nothing Then Exit Sub
    xName = Application.GetSaveAsFilename("", "CSV File (*.csv), *.csv")
    xSep = Application.International(xlListSeparator)
    Open xName For Output As #1
    For Each xRow In xRg.Rows
        xStr = ""
        For Each xCell In xRow.Cells
            xStr = xStr & """" & xCell.Value & """" & xSep
        Next
        While Right(xStr, 1) = xSep
            xStr = Left(xStr, Len(xStr) - 1)
        Wend
        Print #1, xStr
    Next
    Close #1
    If Err = 0 Then MsgBox "The file has saved to: " & xName, vbInformation, "Kutools for Excel"
End SubF5를 누르고 엑셀파일에서 셀 영역 지정 후 저장하면 따옴표 추가 저장 된다
728x90
    
    
  LIST
    'Project > PO-MI' 카테고리의 다른 글
| mysql for excel 사용 시 int타입 unmapped (0) | 2021.09.03 | 
|---|---|
| csv를 사용하지 않고 쉼표있는 엑셀 파일 mysql 업로드 (0) | 2021.09.03 | 
| ec2에 파일 업로드 했을 때 mysql 테이블로 옮기기 (0) | 2021.08.07 | 
| Fulfillment follow-up intent 연동 안될 때 (0) | 2021.08.07 | 
| 엔티티 추가하기 (0) | 2021.08.07 | 
 
									
								