Tengo sumas y restas en mi Work_book_open y necesito pasarlas o bien para un modulo o para otro evento y que los resultados ..
Tengo la Siguiente suma y restas en mi Workbook_Open y necesito pasarla para un normal evento, y tengo dificultades con ello.
Private Sub Workbook_Open()
SplashForm.Show
ThisWorkbook.Application.Visible = False
lastrow = Sheets("MKP").Cells(Rows.Count, "A").End(xlUp).Row
Sheets("MKP").Range("AE:AN").Locked = False
With Range("AE2:AI" & lastrow)
.Formula = "=sum(G2:G100)"
End With
'
With Range("AJ2:AN" & lastrow)
.Formula = "=sum(O2:O100)"
End With
'
Sheets("MKP").Range("AE:AN").Locked = True
'
Sheets("MKP").Range("BI:BR").Locked = False
With Range("BI2:BM" & lastrow)
.Formula = "=sum(AY2:AY100)"
End With
'
With Range("BN2:BR" & lastrow)
.Formula = "=sum(BD2:BD100)"
End With
'
Sheets("MKP").Range("BI:BR").Locked = True
'
'
Sheets("MKP").Range("AE:AN").Locked = False
With Range("CC2:CG" & lastrow)
.Formula = "=sum(AE2:AE100)-sum(Aj2:AJ100)"
End With
Sheets("MKP").Range("AE:AN").Locked = True
'
Sheets("MKP").Range("Bj:AR").Locked = False
With Range("CH2:CL" & lastrow)
.Formula = "=sum(Bj2:Bj100)-sum(BN2:BN100)"
End With
'
Sheets("MKP").Range("BJ:AR").Locked = True
End Sub