- Katılım
- 1 Ağustos 2019
- Mesajlar
- 839
- Excel Vers. ve Dili
-
Türkçe excel 2016
İngilizce excel 2016
- Altın Üyelik Bitiş Tarihi
- 19-10-2021
Bu makroyu sağolsun korhan bey yazmıştı. çokta işimi görüyor. Bu makrodaki tek sorun verileri aktardığım sayfadaki formülleri silmesi. Ben buna formüllerin bulunduğu hücreleri koruyarak çözüm bulmuştum. Bu makronun formülleri silmesinin sebebi ne olabilir acaba
Kod:
Option Explicit
Sub Aktar()
On Error Resume Next
Dim s1 As Worksheet, S2 As Worksheet
Dim liste As Variant, x As Long, Zaman As Double
Dim Tc_Bul As Range, son As Long, Y As Byte, Baslik As Range
Zaman = Timer
Application.ScreenUpdating = False
Set s1 = Sheets("ANA SAYFA")
Set S2 = Sheets("VERI AKTARMA")
son = s1.Cells(s1.Rows.Count, 3).End(3).Row
liste = s1.Range("A2:Y" & son).Value
For x = 1 To UBound(liste)
If liste(x, 23) = "Etkin" Then
Set Tc_Bul = S2.Range("A:A").Find(liste(x, 2), , , xlWhole)
If Not Tc_Bul Is Nothing Then
For Y = 2 To S2.Cells(1, Columns.Count).End(1).Column
If WorksheetFunction.CountA(S2.Columns(Y)) - 1 > 0 Then
Set Baslik = s1.Rows(1).Find(S2.Cells(1, Y), , , xlWhole)
If Not Baslik Is Nothing Then
liste(x, Baslik.Column) = S2.Cells(Tc_Bul.Row, Y)
End If
End If
Next
End If
End If
Next
s1.Range("A2:Y" & UBound(liste) + 1) = liste
Set Tc_Bul = Nothing
Set Baslik = Nothing
Set s1 = Nothing
Set S2 = Nothing
Application.ScreenUpdating = True
MsgBox "Aktarma islemi tamamlanmıstır." & Chr(10) & Chr(10) & _
"Islem süresi ; " & Format(Timer - Zaman, "0.00") & " Saniye", vbInformation
End Sub