Showing posts with label Concatenation. Show all posts
Showing posts with label Concatenation. Show all posts

Wednesday, August 10, 2011

Concatenation of All String in Selection

if you want to Concatenate Some Data you can use this Code :




Sub ConcateAll()
    Dim Resultcell As Range
    Dim rng As Range
    Dim cell As Range
    Dim resultString As String
    Set rng = Application.InputBox("Please select A Range For Input ", , , , , , , 8)
    Set Resultcell = Application.InputBox("Please select A Range For Out ", , , , , , , 8)
    resultString = ""
    For Each cell In rng
        resultString = resultString & " " & cell.Value
    Next
    Resultcell = resultString
End Sub