Escolar Documentos
Profissional Documentos
Cultura Documentos
Sheets("Summary").Activate
Next
Sub sendmultiple()
xTxt = ActiveWindow.RangeSelection.Address
Set xRg = Application.InputBox("Please select the addresses list:", "Kutools for Excel", xTxt, , , , , 8)
xEmailAddr = xCell.Value
Else
xEmailAddr = xEmailAddr & ";" & xCell.Value
End If
End If
Next
With xMItem
.To = xEmailAddr
.Display
End With
End Sub
Sub EmailAttachmentRecipients()
xTxt = ActiveWindow.RangeSelection.Address
Set xRg = Application.InputBox("Please select the arresses list:", "Kutools for Excel", xTxt, , , , , 8)
xEmailAddr = xCell.Value
Else
End If
End If
Next
With xMailItem
.To = xEmailAddr
.CC = ""
.Subject = ""
.Body = ""
.Attachments.Add ActiveWorkbook.FullName
.Display
End With
End Sub
Option Explicit
Sub ExcelDiet()
Dim j As Long
Dim k As Long
Dim ws As Worksheet
Application.ScreenUpdating = False
Application.DisplayAlerts = False
With ws
On Error GoTo 0
LastCol = 0
Else
LastCol = ColFormula.Column
End If
End If
LastRow = 0
Else
LastRow = RowFormula.Row
End If
End If
'Determine if any shapes are beyond the last row and last column
j=0
k=0
j = Shp.TopLeftCell.Row
k = Shp.TopLeftCell.Column
On Error GoTo 0
j=j+1
Loop
LastRow = j
End If
k=k+1
Loop
LastCol = k
End If
End If
Next
.Range(.Cells(1, LastCol + 1), .Cells(.Rows.Count, .Columns.Count)).EntireColumn.Delete
End With
Next
Application.ScreenUpdating = True
Application.DisplayAlerts = True
End Sub
I found this VBA script to reduce Excel file size; in my case it reduces the original Excel file from 59.9 MB
to 40 KB… What a shrink J
With wks
myLastRow = 0
myLastCol = 0
myLastRow = _
.Cells.Find("*", after:=.Cells(1), _
LookIn:=xlFormulas, lookat:=xlWhole, _
searchdirection:=xlPrevious, _
searchorder:=xlByRows).Row
myLastCol = _
.Cells.Find("*", after:=.Cells(1), _
LookIn:=xlFormulas, lookat:=xlWhole, _
searchdirection:=xlPrevious, _
searchorder:=xlByColumns).Column
On Error GoTo 0
.Columns.Delete
Else
.Range(.Cells(myLastRow + 1, 1), _
.Cells(.Rows.Count, 1)).EntireRow.Delete
.Cells(1, .Columns.Count)).EntireColumn.Delete
End If
End With
Next wks
End Sub
View Course
I NEED A SOLUTION
Status: Solved Priority: Medium Security: Public Views: 3124 Last Modified: 2014-08-18
How to reduce excel file size
Hi All
i have been searching how to reduce an excel file size, as in my company, some of the excel file has
reached over 100mb due to many macro has been added in the excel file, and i found below in some
forum, and any idea how do i do below ?
opy this code into your personal workbook, then run the resetallusedranges macro and see if that helps
after you save the workbook:
Sub ResetAllUsedRanges()
ResetUsedRange wks
Next wks
End Sub
lngLastRow = 1
lngLastCol = 1
With wks
With .Range("A1").SpecialCells(xlCellTypeLastCell)
lngLastRow = .Row
lngLastCol = .Column
End With
Debug.Print .UsedRange.Count
End With
End Sub
Dim r As Range
Set r = Range("B2:D5")
r.Copy
outMail.Display
wordDoc.Range.PasteAndFormat wdChartPicture
alternative is then to paste as an image in Excel, and then cut and paste that image into your e-mail:
Dim r As Range
Set r = Range("B2:D5")
r.Copy
Dim p As Picture
Set p = ActiveSheet.Pictures.Paste
p.Cut
outMail.Display
'Paste picture
wordDoc.Range.Paste