- Ustvarite nov delovni zvezek z izbiro.
- Delovni zvezek shranite, preden ga pošljete po pošti.
- Po pošiljanju izbrišite datoteko s trdega diska.
Prikazal bo skrite vrstice in stolpce v izboru
Vse prazne celice zunaj izbora so skrite (glej posnetek zaslona)
Na ta način je izbira vedno na vrhu lista
Sub Mail_Selection () Dim strDate As String Dim Addr As String Dim rng As Range If ActiveWindow.SelectedSheets.Count> 1 Ali Selection.Areas.Count> 1 Nato zapustite Sub Application.ScreenUpdating = False Addr = Selection.Address ActiveSheet.Copy ActiveSheet. Slike.Izbriši s celicami. SpecialCells (xlVisible) .EntireColumn.Clear rng (1) .EntireRow.SpecialCells (xlVisible) .EntireColumn.Hidden = True. Hidden = False End Z rng.EntireRow. Hidden = True rng (1) .EntireClumn.Special .EntireRow.Clear rng (1) .EntireColumn.SpecialCells (xlVisible) .EntireRow.Hidden = True .Hidden = False End With Application.GoTo rng, True rng.Cells (1). Izberite strDate = Format (Datum, "dd- mm-yy ") &" "& Format (Time," h-mm-ss ") ActiveWorkbook.SaveAs" Del "& ThisWorkbook.Name _ &" "& strDate &" .xls "ActiveWorkbook.SendM ail "[email protected]", _ "To je vrstica Zadeva" ActiveWorkbook.ChangeFileAccess xlReadOnly Kill ActiveWorkbook.FullName ActiveWorkbook.Close False Application.ScreenUpdating = True End Sub