• DİKKAT

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

otomatik satır ekleme

  • Konbuyu başlatan Konbuyu başlatan tkcargo
  • Başlangıç tarihi Başlangıç tarihi
Katılım
11 Haziran 2009
Mesajlar
64
Excel Vers. ve Dili
16 Türkçe
arkadaslar merhaba
ornekte gonderdigim dosyada a sutununda belirledigim veri herhangi bir satırda varsa otomatik olarak altına bos bir satır acılmasını istiyorum ornegin a3 hucresinde 1332 var bu sayi a sutunuda herhangi bir yerde oldugunda altina satir acmasi gibi ve bunu buton basınca yaparsa sevinirim yardımlarınız icin tesekkurler
 

Ekli dosyalar

yanıt

Kod:
Sub satırac()
Dim sat As Integer
    For sat = 1 To Cells(65536, "a").End(xlUp).Row
        If Cells(sat, "a") Like [a3] Then
            Cells(sat, "a").EntireRow.Offset(1, 0).Insert shift:=xlDown
        End If
    Next
End Sub
 
hocam cok tesekkurler formulde a3 yazan yere ornegin 1184 yazınca calısıyor altına satır ekliyor tekrar saol birde yine bununla ilgili olarak acılan bos satirin c sutununa istedegim bir veriyi otomatik olarak yerlestirebilirmiyiz mesela acian bos satirin c sutununa 'bah' yazsın
 
yanıt

Kod:
Sub satırac()
Dim sat As Integer
    For sat = 1 To Cells(65536, "a").End(xlUp).Row
        If Cells(sat, "a") Like [a3] Then
            Cells(sat, "a").EntireRow.Offset(1, 0).Insert shift:=xlDown
            Cells(sat, "c").Offset(1, 0) = "Bah"
        End If
    Next
End Sub
 
If Cells(sat, "a") Like [1176] Then
Cells(sat, "a").EntireRow.Offset(1, 0).Insert shift:=xlDown
Cells(sat, "c").Offset(1, 0) = "DOH"

ustam cok guzel tam istedigim gibi yalniz ben bunu cogaltamıyorum cunku satır acmasını istedigim 10-15 tane veri var bunları nasıl ekleriz denedim hata verdi
 
ziya bey acil yardımınızı bekliyorum tesekkurler
 
Merhaba,
Aşağıdaki satırı kendinize göre çoğaltın. Or kullanacaksınız. Örnek olması için tahmini veriler yazdım.
Kod:
If Cells(sat, "a") = "1176" Or  Cells(sat, "a") = "2176" Or  Cells(sat, "a") = "3176" Then
 
leumruk tesekkur ederim ama zannedersem sizin oneriniz hep ayni deger atancaksa gecerli olur benim istedigim ornegin a1 hucresinde 1202 var bunun altina bos satiri actık ve c2 hucresinede 'bah' ekledik buraya kadar ziya beyin verdigi formul cok guzel fakat yine ornegin a3 hucresinde 1332 var bununda altına bos satır ekleyıp c4 hucresine baska deger vericem ve boyle 10-15 tane farklı deger var
 
Vereceğiniz değerleri ve numaraları yazın, yapayım.
 
tamam
1937 icin altına satır ve c degeri dkr
1951 icin altına satır ve c degeri spl
1845 icin altına satır ve c degeri gru
1661 icin altına satır ve c degeri osl
 
Kodu kontrol etme şansım olmadı. Siz dosyanızda deneyin, problem olursa düzenleyelim.
Kod:
Sub satırac()
Dim sat As Integer
For sat = 1 To Cells(65536, "a").End(xlUp).Row
If Cells(sat, "a") = "1937" Then
Cells(sat, "a").EntireRow.Offset(1, 0).Insert shift:=xlDown
Cells(sat, "c").Offset(1, 0) = "dkr"
ElseIf Cells(sat, "a") = "1951" Then
Cells(sat, "a").EntireRow.Offset(1, 0).Insert shift:=xlDown
Cells(sat, "c").Offset(1, 0) = "spl"
ElseIf Cells(sat, "a") = "1845" Then
Cells(sat, "a").EntireRow.Offset(1, 0).Insert shift:=xlDown
Cells(sat, "c").Offset(1, 0) = "gru"
ElseIf Cells(sat, "a") = "1661" Then
Cells(sat, "a").EntireRow.Offset(1, 0).Insert shift:=xlDown
Cells(sat, "c").Offset(1, 0) = "osl"
End If
Next
End Sub
 
satır ekle sil

http://s8.dosya.tc/server/4fy5ft/SATIR_EKLE-SIL.xlsx.html

yukarıdaki adreste örnek dosyam var.E1 hücre değerine göre 13 satırlık aralık liste boş olsa bile sabit kalcak listenin 12 satırı geçmesine göre satır eklencek ve listenin temizlenmesine durumunda en düşük 13 satır olmak üzere silinecek..TEŞEKÜRLER
 
Geri
Üst