Combine multiple cells into one in excel with macro?

后端 未结 3 1942
独厮守ぢ
独厮守ぢ 2021-01-05 07:04

I have a similar question to this one:

Merge the contents of 2 cells into another 3rd cell using VBA in Excel

But I want to combine a range of cells within a

3条回答
  •  花落未央
    2021-01-05 07:24

    Just to add to Mike's solution, if you want to get your range from a variable instead of a defined range (I had trouble with the syntax):

    Sub MyMacro()
    
    dim myVar As Range
    
        MsgBox ConcatinateAllCellValuesInRange(myVar)
    
    End Sub
    

提交回复
热议问题