- Opret en ny projektmappe med markeringen.
- Gem projektmappen, før du sender den.
- Slet filen fra din harddisk, efter at den er sendt.
Det vil vise skjulte rækker og kolonner i markeringen
Alle tomme celler uden for markeringen er skjult (se skærmbillede)
På denne måde er valget altid øverst på dit ark
Sub Mail_Selection () Dim strDate As String Dim Addr As String Dim rng As Range If ActiveWindow.SelectedSheets.Count> 1 Eller Selection.Areas.Count> 1 Afslut derefter Sub Application.ScreenUpdating = False Addr = Selection.Adress ActiveSheet.Copy ActiveSheet. Pictures.Delete With Cells .EntireColumn.Hidden = False .EntireRow.Hidden = False End With Range (Addr) .Vælg 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 () .EntireRow.Clear rng (1) .EntireColumn.SpecialCells (xlVisible) .EntireRow.Hidden = True .Hidden = False End With Application.GoTo rng, True rng.Cells (1) .Vælg strDate = Format (Date, "dd- mm-åå ") &" "& Format (tid," h-mm-ss ") ActiveWorkbook.SaveAs" Del af "& ThisWorkbook.Name _ &" "& strDate &" .xls "ActiveWorkbook.SendM ail "[email protected]", _ "Dette er emnelinjen" ActiveWorkbook.ChangeFileAccess xlReadOnly Kill ActiveWorkbook.FullName ActiveWorkbook.Close False Application.ScreenUpdating = True End Sub