• DİKKAT

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

Kodu tüm sütun boyunca uygulama

Katılım
17 Mart 2017
Mesajlar
7
Excel Vers. ve Dili
2015
Merhaba
Aşağıdaki makro kodu A1 deki HTML yazıyı Düz metne yani text formatına çeviriyor ve B1 e atıyor. İhtiyacım olan şey aynı formülü diğer sütunlara da uygulamak. Yani A2 yi B2 ye A3 ü B3 e atarak aşağı doğru tüm sütunlara devam edecek aynı işlemi. Basit formüllerde aşağı doğru sürükleyince olan işleme ihtiyacım var yani. Ne yazık ki makroda olmuyor aynı şey kolayca. kodu hazır forumdan aldığım için ne yapmam gerektiğini bulamadım.

Sub Kod()
bul = Array("&Uuml;", "&Ccedil;", "&uuml;", "&ouml;", "&Ouml;", "&ccedil;", "&nbsp;", ">", "<")
deg = Array("Ü", "Ç", "ü", "ö", "Ö", "ç", "", ">", "<")
metin = Range("A1")
For a = LBound(bul) To UBound(bul)
metin = Replace(metin, bul(a), deg(a))
Next
Set IE = CreateObject("InternetExplorer.Application")
With IE
.Navigate "about:blank"
.Document.Open
.Document.Write "<HTML>" & metin & "</HTML>"
.Document.Close
Range("B1") = .Document.all(0).innertext
IE.Quit
End With
End Sub
 
Merhaba,

Bu şekilde deneyin.

Kod:
Sub Kod()

    bul = Array("&Uuml;", "&Ccedil;", "&uuml;", "&ouml;", "&Ouml;", "&ccedil;", "&nbsp;", ">", "<")
    deg = Array("Ü", "Ç", "ü", "ö", "Ö", "ç", "", ">", "<")
    
    [COLOR="red"]For i = 1 To Cells(Rows.Count, "A").End(xlUp).Row[/COLOR] [COLOR="DarkOliveGreen"]'A1 yerine A sütunu döngüye alınır[/COLOR]
    
        For a = LBound(bul) To UBound(bul)
            [COLOR="Blue"]Cells(i, "A")[/COLOR] = Replace([COLOR="blue"]Cells(i, "A")[/COLOR], bul(a), deg(a))
        Next a
        
        Set IE = CreateObject("InternetExplorer.Application")
        With IE
            .Navigate "about:blank"
            .Document.Open
            .Document.Write "<HTML>" & [COLOR="blue"]Cells(i, "A")[/COLOR] & "</HTML>"
            .Document.Close
            [COLOR="blue"]Cells(i, "B")[/COLOR] = .Document.all(0).innertext
            IE.Quit
        End With
    
    [COLOR="Red"]Next i[/COLOR]
    
End Sub

.
 
Harika! çok teşekkür ederim
 
Geri
Üst