Merhaba,
Sub Sayfa_adi_degistir_hücreden_al()
For i = 3 To Worksheets.Count
Sheets(i).Name = Sheets(i).Range("B2")
Next i
End Sub
kodları ile işlem gerçekleşiyor.
Ancak bazı sayfalarda "B2" hücresinde aynı değer gelebiliyor ve dolayısıyla hata veriyor.
Tekrar eden değerlere gelindiğinde, sayfa adlarının sonuna; ilk tekrarda "_D1", 2.' sinde "_D2", .........., "_D(i)" şeklinde belirteçler eklenebilirmi.Yalnız her yeni tekrarlayan değerlerde "_D" belirtecinin tekrar 1' den başlaması gerekiyor.
Örneğin;
Sayfa 1 ("B2") hücresi=150 =>Sayfa 1 adı =150 olacaktır
Sayfa 2 ("B2") hücresi=150 =>Sayfa 2 adı =150_D1 olsun
Sayfa 3 ("B2") hücresi=180 =>Sayfa 3 adı =180 olacaktır
Sayfa 4 ("B2") hücresi=180 =>Sayfa 4 adı =180_D1
Sayfa 5 ("B2") hücresi=180 =>Sayfa 5 adı =180_D2
olsun
gibi.
Teşekkürler.
Sub Sayfa_adi_degistir_hücreden_al()
For i = 3 To Worksheets.Count
Sheets(i).Name = Sheets(i).Range("B2")
Next i
End Sub
kodları ile işlem gerçekleşiyor.
Ancak bazı sayfalarda "B2" hücresinde aynı değer gelebiliyor ve dolayısıyla hata veriyor.
Tekrar eden değerlere gelindiğinde, sayfa adlarının sonuna; ilk tekrarda "_D1", 2.' sinde "_D2", .........., "_D(i)" şeklinde belirteçler eklenebilirmi.Yalnız her yeni tekrarlayan değerlerde "_D" belirtecinin tekrar 1' den başlaması gerekiyor.
Örneğin;
Sayfa 1 ("B2") hücresi=150 =>Sayfa 1 adı =150 olacaktır
Sayfa 2 ("B2") hücresi=150 =>Sayfa 2 adı =150_D1 olsun
Sayfa 3 ("B2") hücresi=180 =>Sayfa 3 adı =180 olacaktır
Sayfa 4 ("B2") hücresi=180 =>Sayfa 4 adı =180_D1
Sayfa 5 ("B2") hücresi=180 =>Sayfa 5 adı =180_D2
olsun
gibi.
Teşekkürler.
Son düzenleme: