0
在我的代碼中,有一些引用了其他工作表,但我不知道爲什麼,如果這些工作表不可見,宏給出錯誤:「工作表類的可見方法失敗」。如果工作表不可見,VBA會給出錯誤
你們能幫我嗎?
代碼開始就是這樣,我得到的錯誤只是'Worksheets("Ders_TEMP").Visible
Sub Ders_Rapor()
Application.ScreenUpdating = False
LastRowXLC = Worksheets("Egitim Bilgileri").Cells(Rows.Count, 1).End(xlUp).Row
Ders_Adi_Sec.ComboBox1.List = Worksheets("Egitim Bilgileri").Range("C2:C" & LastRowXLC & "").Value
Ders_Adi_Sec.Show
Worksheet_Bilgiler = "Egitim Bilgileri"
If Ders_Adi_Sec.ComboBox1.Value = "" Then MsgBox "Lütfen Ders Seçiniz"
If Ders_Adi_Sec.ComboBox1.Value = "" Then GoTo Son
Ders_Adi_2 = Ders_Adi_Sec.ComboBox1.Value
Dim Found_Ders As Range
Set Found_Ders = Sheets("Egitim Bilgileri").Columns("C").Find(Ders_Adi_2, LookIn:=xlValues, lookat:=xlWhole)
Ders_Adi_Row = Found_Ders.Row
Ders_Sheet_Adi = Worksheets("Egitim Bilgileri").Cells(Ders_Adi_Row, 1).Value
Ders_Satir_bul = Found_Ders.Row
' Ders_Satir_bul degeri, aratilan egitimin, "Egitim_Bilgileri" sayfasindaki satir numarasidir.
Worksheets("Ders_TEMP").Visible
Worksheets("Egitim Bilgileri").Visible
Worksheets(Ders_Sheet_Adi).Visible
Worksheets(Worksheet_Bilgiler).Cells(Ders_Satir_bul, 3).Copy
Application.ScreenUpdating = False
Worksheets("Ders_TEMP").Activate
Worksheets("Ders_TEMP").Select
Worksheets("Ders_TEMP").Range("A2:J2").Select
ActiveSheet.Paste
Worksheets("Ders_TEMP").Range("A49:J49").Select
ActiveSheet.Paste
Worksheets("Ders_TEMP").Range("A96:J96").Select
ActiveSheet.Paste