Belgemi kaydetmeden hemen önce makronumun nasıl aranacağını arıyorum. Bunu buldum, ama kodumu içine koyduğumda, hiçbir şey yapmıyor. Yani bir şeyi kaçırdığımı farz ediyorum.Excel VBA - Kaydetmeden önce makroyu çalıştır
Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)
Set shtVO = Sheets("Voice orders")
endRowVO = shtVO.Range("E" & Rows.Count).End(xlUp).Row
For Row = 11 To endRowVO
If IsEmpty(shtVO.Cells(Row, 23).Value) = False Then
If shtVO.Cells(Row, 3).Value <> shtVO.Cells(Row, 23) Then
If shtVO.Cells(Row, 1).Value Like "*MIG*" Then
Else
shtVO.Cells(Row, 1).Value = shtVO.Cells(Row, 1).Value + "MIG"
End If
End If
End If
Next Row
End Sub
Eğer 'ThisWorkbook' modülünde bu kodu koymak mı
ThisWorkbook
modülünde kodunuzu? –Neyin içinde? Üzgünüm, hepsi yeni. – CustomX
Neler çalışmıyor? Kaydetmeden önce ne yapmaya çalışıyordun? – Passerby