Application.ScreenUpdating = False ' al principio de la macro
Application.ScreenUpdating = True 'al final de la macro
Application.ScreenUpdating = False ' al principio de la macro
Application.ScreenUpdating = True 'al final de la macro
PONER EN THISWORBOOK
Dim pfil As Double
Dim ufil As Double
Dim pcol As Double
Dim ucol As Double
Dim sum As Double
pcol = Range(Selection.Address).Column
ucol = Range(Selection.Address).Column + Selection.Columns.Count - 1
pfil = Range(Selection.Address).Row
ufil = Range(Selection.Address).Row + Selection.Rows.Count - 1
a = Range(Cells(pfil, pcol), Cells(ufil, ucol))
sum = Application.WorksheetFunction.sum(a)
MsgBox ("Suma: ") & Format(sum, "#,##0.00")
End Sub
Sub buscalotes()
Dim variable As String
Dim resultado As Range
rango = "D2:J132"
variable = InputBox("Lote a buscar: ")
If variable = "" Then Exit Sub
Set resultado = Range(rango).Find(variable, LookAt:=xlWhole)
If Not resultado Is Nothing Then
Range(resultado.Address).Select
Else
MsgBox "No existe el lote"
End If
End Sub