Seçimi ters yöne çevirme

Katılım
4 Şubat 2021
Mesajlar
6
Excel Vers. ve Dili
Excel 2016 English
Selamlar, aşağıdaki kodu şu şekilde çalıştırıyorum: =TEXTJOIN("";TRUE;B4:E10) ama buradaki seçili hücreleri tesine çevirmek istiyorum yani B4:E10 yerine B10:E4 gibi. Bunu yapmanın bir yolu var mı?


Function TEXTJOIN(delimiter As String, ignore_empty As Boolean, ParamArray cell_ar() As Variant)
For Each cellrng In cell_ar
For Each Cell In cellrng
If ignore_empty = False Then
Result = Result & Cell & delimiter
Else
If Cell <> "" Then
Result = Result & Cell & delimiter
End If
End If
Next Cell
Next cellrng
TEXTJOIN = Left(Result, Len(Result) - Len(delimiter))
End Function
 
Katılım
4 Şubat 2021
Mesajlar
6
Excel Vers. ve Dili
Excel 2016 English
Mesela buradaki sayıları, hücrelerini değiştirmeden sondan başa doğru birleştirerek yazmak istiyorum. B5'ten A1'e doğru: 11252...32 gibi.

 

Korhan Ayhan

Administrator
Yönetici
Admin
Katılım
15 Mart 2005
Mesajlar
42,731
Excel Vers. ve Dili
Microsoft 365 Tr-En 64 Bit
Fonksiyona bir parametre daha ekledim.

Sıralama parametresi olarak TRUE ve FALSE parametrelerini kullanabilirsiniz.

Örnek görsele göre =TEXTJOIN("";TRUE;FALSE;A1:B5) olarak kullanabilirsiniz.

C++:
Function TEXTJOIN(delimiter As String, ignore_empty As Boolean, Sort As Boolean, ParamArray cell_ar() As Variant)
    For Each cellrng In cell_ar
        For Each cell In cellrng
            If ignore_empty = False Then
                If Sort = False Then
                    Result = cell & delimiter & Result
                Else
                    Result = Result & delimiter & cell
                End If
            Else
                If cell <> "" Then
                    If Sort = False Then
                        Result = cell & delimiter & Result
                    Else
                        Result = Result & delimiter & cell
                    End If
                End If
            End If
        Next cell
    Next cellrng
    
    TEXTJOIN = Left(Result, Len(Result) - Len(delimiter))
End Function
 
Katılım
4 Şubat 2021
Mesajlar
6
Excel Vers. ve Dili
Excel 2016 English
Fonksiyona bir parametre daha ekledim.

Sıralama parametresi olarak TRUE ve FALSE parametrelerini kullanabilirsiniz.

Örnek görsele göre =TEXTJOIN("";TRUE;FALSE;A1:B5) olarak kullanabilirsiniz.

C++:
Function TEXTJOIN(delimiter As String, ignore_empty As Boolean, Sort As Boolean, ParamArray cell_ar() As Variant)
    For Each cellrng In cell_ar
        For Each cell In cellrng
            If ignore_empty = False Then
                If Sort = False Then
                    Result = cell & delimiter & Result
                Else
                    Result = Result & delimiter & cell
                End If
            Else
                If cell <> "" Then
                    If Sort = False Then
                        Result = cell & delimiter & Result
                    Else
                        Result = Result & delimiter & cell
                    End If
                End If
            End If
        Next cell
    Next cellrng
   
    TEXTJOIN = Left(Result, Len(Result) - Len(delimiter))
End Function
Çok teşekkür ederim :) Mükemmel
 
Katılım
4 Şubat 2021
Mesajlar
6
Excel Vers. ve Dili
Excel 2016 English
Fonksiyona bir parametre daha ekledim.

Sıralama parametresi olarak TRUE ve FALSE parametrelerini kullanabilirsiniz.

Örnek görsele göre =TEXTJOIN("";TRUE;FALSE;A1:B5) olarak kullanabilirsiniz.

C++:
Function TEXTJOIN(delimiter As String, ignore_empty As Boolean, Sort As Boolean, ParamArray cell_ar() As Variant)
    For Each cellrng In cell_ar
        For Each cell In cellrng
            If ignore_empty = False Then
                If Sort = False Then
                    Result = cell & delimiter & Result
                Else
                    Result = Result & delimiter & cell
                End If
            Else
                If cell <> "" Then
                    If Sort = False Then
                        Result = cell & delimiter & Result
                    Else
                        Result = Result & delimiter & cell
                    End If
                End If
            End If
        Next cell
    Next cellrng
   
    TEXTJOIN = Left(Result, Len(Result) - Len(delimiter))
End Function
Önceki mesajımda sıralamayı yanlış yapmışım. Eğer mümkünse yine aynı örnekten gidersek hücredeki sayıları tek bir seçim işlemi yaparak 521124840055223212 yani A5;B5;A4;B4;A3;B3;A2;B2;A1;B1 olarak sıralayabilirmiyiz?
 

Korhan Ayhan

Administrator
Yönetici
Admin
Katılım
15 Mart 2005
Mesajlar
42,731
Excel Vers. ve Dili
Microsoft 365 Tr-En 64 Bit
Deneyiniz.

Görselde ki verileriniz için =TEXTJOIN("";TRUE;A1:B5) gibi kullanınız.

C++:
Function TEXTJOIN(delimiter As String, ignore_empty As Boolean, ParamArray cell_ar() As Variant)
    For Each cellrng In cell_ar
        For Each cell In cellrng
            If ignore_empty = False Then
                Result = cell & delimiter & Result
            Else
                Count = Count + 1
                If cell <> "" Then
                    Result = Result & delimiter & cell
                End If
            End If
            If Count = cellrng.Columns.Count Then
                My_text = Result & My_text: Result = "": Count = 0
            End If
        Next cell
    Next cellrng
   
    TEXTJOIN = Left(My_text, Len(My_text) - Len(delimiter))
End Function
 
Katılım
4 Şubat 2021
Mesajlar
6
Excel Vers. ve Dili
Excel 2016 English
Deneyiniz.

Görselde ki verileriniz için =TEXTJOIN("";TRUE;A1:B5) gibi kullanınız.

C++:
Function TEXTJOIN(delimiter As String, ignore_empty As Boolean, ParamArray cell_ar() As Variant)
    For Each cellrng In cell_ar
        For Each cell In cellrng
            If ignore_empty = False Then
                Result = cell & delimiter & Result
            Else
                If cell <> "" Then
                    Result = Result & delimiter & cell
                    Count = Count + 1
                End If
            End If
            If Count = cellrng.Columns.Count Then
                My_text = Result & My_text: Result = "": Count = 0
            End If
        Next cell
    Next cellrng
   
    TEXTJOIN = Left(My_text, Len(My_text) - Len(delimiter))
End Function
Korhan bey, ayırdığınız vakit ve emeğiniz için çok teşekkür ediyorum. :)

 

Korhan Ayhan

Administrator
Yönetici
Admin
Katılım
15 Mart 2005
Mesajlar
42,731
Excel Vers. ve Dili
Microsoft 365 Tr-En 64 Bit
#6 nolu mesajımı revize ettim. Tekrar deneyiniz.

Hücrenin alabileceği karakter sınırı vardır. Bunu aşarsanız hata ile karşılaşırsınız.

Sınırlarla ilgili linki inceleyebilirsiniz.

 
Katılım
4 Şubat 2021
Mesajlar
6
Excel Vers. ve Dili
Excel 2016 English
Büyük bir faydanız dokundu. Herşey olması gerektiği gibi. Tekrar çok teşekkürler.
 
Üst