Merhaba arkadaşlar.
Aşağıdaki kod ile liste isimli sekmede bulunan verilere göre şablon isimli sekmenin kopyasını üretiyor.
Userform2, userform3 ve userform4 de bulunan aşağıdaki kodlar sebebiyle bu işlemi yaparken microsoft office excel çalışmayı durdurdu diye hata mesajı vererek çalışmayı kapatıyor.
Sorunu nasıl gideririz bileniyorum.
Aşağıdaki kod ile liste isimli sekmede bulunan verilere göre şablon isimli sekmenin kopyasını üretiyor.
Kod:
Sub Düğme7_Tıklat()
For a = 3 To Sayfa2.Range("a65536").End(3).Row
Sheets("Şablon").Copy After:=Sheets(Sheets.Count)
With ActiveSheet
.Name = CStr(Sayfa2.Cells(a, 1).Value)
.Range("b3").Value = Sayfa2.Cells(a, "b").Value
.[a31].Value = Sayfa2.Cells(a, "b").Value
.[e31].Value = Sayfa2.Cells(a, "c").Value
.[F31].Value = Sayfa2.Cells(a, "d").Value
End With
Next a
End Sub
Userform2, userform3 ve userform4 de bulunan aşağıdaki kodlar sebebiyle bu işlemi yaparken microsoft office excel çalışmayı durdurdu diye hata mesajı vererek çalışmayı kapatıyor.
Kod:
Private Sub UserForm_Activate()
Dim X As Integer
Dim current As Variant
Dim Y As String
Y = UserForm3.Caption
UserForm3.Caption = "www.ExcelVBA.Net - Excel VBA Destek Sitesi -"
For X = 0 To Len(Y)
If X = 0 Then
UserForm3.Caption = "www.ExcelVBA.Net - Excel VBA Destek Sitesi -"
current = Timer
Do While Timer - current < 0.1
DoEvents
Loop
GoTo bitti
Else: End If
UserForm3.Caption = Left(Y, X)
current = Timer
Do While Timer - current < 0.05
DoEvents
Loop
bitti:
Next X
End Sub
Sorunu nasıl gideririz bileniyorum.
