• DİKKAT

    DOSYA İndirmek/Yüklemek için ÜCRETLİ ALTIN ÜYELİK Gereklidir!
    Altın Üyelik Hakkında Bilgi

Ana sayfada kod çalışmasın diğer tüm sayfalarda çalışsın

Katılım
21 Ekim 2012
Mesajlar
62
Excel Vers. ve Dili
XLSX
Arkadaşlar Kolay gelsin,

Ekteki dosyada master sayfasında kod çalışmasın diğer tüm sayfalarda çalışsın istiyorum. Bu konuda aradım ama çok bişey yapamadım yardımcı olur musunuz.
 
Ekte dosya görünmüyor maalesef. Kullandığınız makroda

if activesheet.name <>"master" then

satırı eklerseniz seçili sayfanın ismi master değilse sonraki kodlar çalışır. Kodunuzda işlemler nasıl yapılıyor bilirsek daha net çözüm bulunabilir.
 
dosya büyük olduğu için yükleme yapmamış kodlar aşağıdaki gibi modulde yazıyor

Sub Kutu()
For i = 1 To 28

If Cells(1, i) > Sheets("Master").Range("G11") Then Cells(6, i) = Cells(1, i) Else Cells(6, i) = ""
If Cells(2, i) > Sheets("Master").Range("J11") Then Cells(7, i) = Cells(2, i) Else Cells(7, i) = ""
If Cells(3, i) > Sheets("Master").Range("M11") Then Cells(8, i) = Cells(3, i) Else Cells(8, i) = ""
If Cells(6, i) <> "" And Cells(7, i) <> "" And Cells(8, i) <> "" Then Cells(9, i) = Cells(6, i) * Cells(7, i) * Cells(8, i) Else Cells(9, i) = ""

Next i

Range("A15") = WorksheetFunction.Min(Range("A9:AB9"))
 
yukarıdaki kodu ekledim evet Master isimli sayfada çalışmıyor ama diğer sayfalarda da tek tek basınca çalışıyor. ben hepsinde aynı anda çalışsın sadece MAster isimli sayfada çalışmasın istiyorum. Teşekkürler
 
Aşağıdaki gibi deneyin:

PHP:
Sub Kutu()

For sayfa = 1 To Sheets.Count
    If Sheets(sayfa).Name <> "Master" Then
        For i = 1 To 28
            If Cells(1, i) > Sheets("Master").Range("G11") Then Cells(6, i) = Cells(1, i) Else Cells(6, i) = ""
            If Cells(2, i) > Sheets("Master").Range("J11") Then Cells(7, i) = Cells(2, i) Else Cells(7, i) = ""
            If Cells(3, i) > Sheets("Master").Range("M11") Then Cells(8, i) = Cells(3, i) Else Cells(8, i) = ""
            If Cells(6, i) <> "" And Cells(7, i) <> "" And Cells(8, i) <> "" Then Cells(9, i) = Cells(6, i) * Cells(7, i) * Cells(8, i) Else Cells(9, i) = ""
        Next i
    End If
    Range("A15") = WorksheetFunction.Min(Range("A9:AB9"))
Next

End Sub
 
Malesef ekteki şekilde yaptım ama masterda çalışıyor diğer sayfalarda tek tek çalışıyor.
 

Ekli dosyalar

Son dosyanıza bakamadım, koddaki hatamı aşağıdaki şekilde düzeltmem gerekiyor:

PHP:
Sub Kutu()

For sayfa = 1 To Sheets.Count
    If Sheets(sayfa).Name <> "Master" Then
        For i = 1 To 28
            If Sheets(sayfa).Cells(1, i) > Sheets("Master").Range("G11") Then Sheets(sayfa).Cells(6, i) = Sheets(sayfa).Cells(1, i) Else Sheets(sayfa).Cells(6, i) = ""
            If Sheets(sayfa).Cells(2, i) > Sheets("Master").Range("J11") Then Sheets(sayfa).Cells(7, i) = Sheets(sayfa).Cells(2, i) Else Sheets(sayfa).Cells(7, i) = ""
            If Sheets(sayfa).Cells(3, i) > Sheets("Master").Range("M11") Then Sheets(sayfa).Cells(8, i) = Sheets(sayfa).Cells(3, i) Else Sheets(sayfa).Cells(8, i) = ""
            If Sheets(sayfa).Cells(6, i) <> "" And Sheets(sayfa).Cells(7, i) <> "" And Sheets(sayfa).Cells(8, i) <> "" Then Sheets(sayfa).Cells(9, i) = Sheets(sayfa).Cells(6, i) * Sheets(sayfa).Cells(7, i) * Sheets(sayfa).Cells(8, i) Else Sheets(sayfa).Cells(9, i) = ""
        Next i
    End If
    Range("A15") = WorksheetFunction.Min(Range("A9:AB9"))
Next

End Sub
 
Neresi olmadı?
 
Master da da çalışıyor. diğer sayfalarda da gidip çalıştırmak gerekiyor kodu. otomatik çalışmıyor. örnek ekledim
 

Ekli dosyalar

Şöyle dener misiniz:

PHP:
Sub Kutu()

For sayfa = 1 To Sheets.Count
    If Sheets(sayfa).Name <> "Master" Then
        For i = 1 To 28
            If Sheets(sayfa).Cells(1, i) > Sheets("Master").Range("G11") Then Sheets(sayfa).Cells(6, i) = Sheets(sayfa).Cells(1, i) Else Sheets(sayfa).Cells(6, i) = ""
            If Sheets(sayfa).Cells(2, i) > Sheets("Master").Range("J11") Then Sheets(sayfa).Cells(7, i) = Sheets(sayfa).Cells(2, i) Else Sheets(sayfa).Cells(7, i) = ""
            If Sheets(sayfa).Cells(3, i) > Sheets("Master").Range("M11") Then Sheets(sayfa).Cells(8, i) = Sheets(sayfa).Cells(3, i) Else Sheets(sayfa).Cells(8, i) = ""
            If Sheets(sayfa).Cells(6, i) <> "" And Sheets(sayfa).Cells(7, i) <> "" And Sheets(sayfa).Cells(8, i) <> "" Then Sheets(sayfa).Cells(9, i) = Sheets(sayfa).Cells(6, i) * Sheets(sayfa).Cells(7, i) * Sheets(sayfa).Cells(8, i) Else Sheets(sayfa).Cells(9, i) = ""
        Next i
    End If
    Sheets(sayfa).Range("A15") = WorksheetFunction.Min(Range("A9:AB9"))
Next

End Sub
 
Yusuf Bey Yardımlarınız için teşekkürler oldu. sadece aşağıdaki sayıların minimumunu alan formul çalışmıyor. döngüye range("A9:AB9") şeklinde girmediği için onuda her sayfada gidip tek tek yapacağım artık sagolun.
 
Son satırı aşağıdakiyle değiştirirseniz olur:

Sheets(sayfa).Range("A15") = WorksheetFunction.Min(Sheets(sayfa).Range("A9:AB9"))

Sorunuzda tam olarak ne amaçladığınız anlaşılmadığı için ve makro çalıştığında sayfanızdaki değişiklikleri gözlemediğim için kontrolü tam yapamamıştım, kusura bakmayın.
 
çok teşerkkür ederim uğraştırdım sizi elinize sağlık
 
Geri
Üst