Tevfik_Kursun
Altın Üye
- Katılım
- 30 Temmuz 2012
- Mesajlar
- 3,903
- Excel Vers. ve Dili
- Office 2016 Pro - Türkçe 64 Bit
DOSYA İndirmek/Yüklemek için ÜCRETLİ ALTIN ÜYELİK Gereklidir!
Altın Üyelik Hakkında Bilgi
Sub Boşluklari_Sil()
Range("B7:C40").Select
Selection.Copy
Range("D7").Select
ActiveSheet.Paste
Application.CutCopyMode = False
Range("D7:D40").Select
ActiveSheet.Range("$D$7:$D$40").RemoveDuplicates Columns:=1, Header:=xlNo
For x = 0 To 33
Cells(7 + x, 4).Select
If Cells(7 + x, 4).Value <> "" Then
GoTo 99
Else
Selection.Delete Shift:=xlUp
End If
99:
Next x
Range("D5").Select
End Sub
Sub Test()
Columns(4).Clear
Columns(2).Copy Columns(4)
Set ilkhucre = Columns(4).Find(what:="*")
For i = Cells(65536, 4).End(3).Row To ilkhucre.Row Step -1
If Len(Cells(i, 4)) = 0 Then Rows(i).Delete
Next
End Sub
If Len(Cells(i, 4)) = 0 Then Row(i).Delete
If Len(Cells(i, 4)) = 0 Then Cells(i, 4).Delete
Sub bossil()
Range("B:B").Copy Range("E1")
Range("E8:E1000").SpecialCells(xlCellTypeBlanks).Delete Shift:=xlUp
End Sub
Merhaba Asri Hocam,
İlginç! Boşluklar "" olmasına rağmen mutlaka hücreyi delete etmek gerekiyor. Kod değer karşılığı da yok. Neden olabilir acaba?
Saygılarımla
Option Explicit
Sub Bosluklari_Temizleyip_Listele()
Dim Veri As Variant, Son As Long
Range("D7:D" & Rows.Count).Clear
Son = Cells(Rows.Count, 2).End(3).Row
Veri = Filter(Application.Transpose(Application.Evaluate("=IF(LEN(B7:B" & Son & ")>0,B7:B" & Son & ",""#"")")), "#", False)
Range("D7").Resize(UBound(Veri) + 1) = Application.Transpose(Veri)
End Sub
@hamitcan , ın kodu yeterli değil mi? cells delete olarak düzenlenince isteneni veriyor.Merhaba Asri Hocam,
Ben de sebebi bulamadım. Bir yol daha düşünüyorum, ama uygulayamadım. Diziye alınıp, çözümlenip D7 den itibaren yazdırılamaz mı?
Saygılarımla
Option Explicit
Sub Bosluklari_Temizleyip_Listele()
Dim Veri As Variant, Son As Long, X As Long, Say As Long
Range("D7:D" & Rows.Count).Clear
Son = Cells(Rows.Count, 2).End(3).Row
If Son <= 7 Then Son = 8
Veri = Range("B7:B" & Son).Value
ReDim Liste(1 To Son, 1 To 1)
For X = LBound(Veri, 1) To UBound(Veri, 1)
If Len(Veri(X, 1)) <> 0 Then
Say = Say + 1
Liste(Say, 1) = Veri(X, 1)
End If
Next
If Say > 0 Then Range("D7").Resize(Say) = Liste
End Sub
Option Explicit
Sub Bosluklari_Temizleyip_Listele()
Dim Baglanti As Object, Kayit_Seti As Object, Sorgu As String
Set Baglanti = CreateObject("AdoDb.Connection")
Set Kayit_Seti = CreateObject("AdoDb.Recordset")
Baglanti.Open "Provider=Microsoft.Ace.OleDb.12.0;Data Source=" & _
ThisWorkbook.FullName & ";Extended Properties=""Excel 12.0;Hdr=No;Imex=1"""
Sorgu = "Select * From [Sayfa1$B7:B] Where Len(F1)>0"
Kayit_Seti.Open Sorgu, Baglanti, 1, 1
Range("D7:D" & Rows.Count).Clear
Range("D7").CopyFromRecordset Kayit_Seti
With Range("D7").Resize(Kayit_Seti.RecordCount)
.NumberFormat = "General"
.Value = .Value
End With
If Kayit_Seti.State <> 0 Then Kayit_Seti.Close
If Baglanti.State <> 0 Then Baglanti.Close
Set Kayit_Seti = Nothing
Set Baglanti = Nothing
End Sub