• 선택으로 새 통합 문서를 만듭니다.

  • 우편으로 보내기 전에 통합 문서를 저장하십시오.

  • 전송 후 하드 디스크에서 파일을 삭제하십시오.

선택 항목에서 숨겨진 행과 열을 숨김 해제합니다. 선택 영역 외부의 모든 빈 셀이 숨겨집니다 (스크린 샷 참조)

이렇게하면 선택 항목이 항상 시트 상단에 표시됩니다

Sub Mail_Selection()

Dim strDate As String

Dim Addr As String

Dim rng As Range

If ActiveWindow.SelectedSheets.Count > 1 Or Selection.Areas.Count > 1 Then Exit Sub

Application.ScreenUpdating = False

Addr = Selection.Address

ActiveSheet.Copy

ActiveSheet.Pictures.Delete

With Cells

.EntireColumn.Hidden = False

.EntireRow.Hidden = False

End With

Range(Addr).Select

Set rng = Selection

Application.GoTo rng, True

With rng.EntireColumn

.Hidden = True

rng(1).EntireRow.SpecialCells(xlVisible).EntireColumn.Clear

rng(1).EntireRow.SpecialCells(xlVisible).EntireColumn.Hidden = True

.Hidden = False

End With

With rng.EntireRow

.Hidden = True

rng(1).EntireColumn.SpecialCells(xlVisible).EntireRow.Clear

rng(1).EntireColumn.SpecialCells(xlVisible).EntireRow.Hidden = True

.Hidden = False

End With

Application.GoTo rng, True

rng.Cells(1).Select

strDate = Format(Date, "dd-mm-yy") & " " & Format(Time, "h-mm-ss")

ActiveWorkbook.SaveAs "Part of " & ThisWorkbook.Name _

& " " & strDate & ".xls"

ActiveWorkbook.SendMail "[email protected]", _

"This is the Subject line"

ActiveWorkbook.ChangeFileAccess xlReadOnly

Kill ActiveWorkbook.FullName

ActiveWorkbook.Close False

Application.ScreenUpdating = True

End Sub