dj44
11-29-2017, 10:20 AM
folks, good day
I know how to transpose a Column.
But what if I only want to transpose selected cells only.
for example all the cells containing "Apple"
I can select the cells - but i dont know how to transpose them into 1 string -to output to cell E1
Sub TransposeTest()
Dim oWs As Worksheet
Set oWs = ThisWorkbook.Worksheets("Sheet1")
With oWs
LastRow = .Cells(Rows.Count, "A").End(xlUp).Row
.Range("A1:A" & LastRow).Select
End With
' What about All the cells containing Apple
oWs.Range("E1") = Join(Application.transpose(Selection)) ' Output RESULT to Cell E1
End Sub
Am i able to do this without filtering the data or how is the best way to do this
I know how to transpose a Column.
But what if I only want to transpose selected cells only.
for example all the cells containing "Apple"
I can select the cells - but i dont know how to transpose them into 1 string -to output to cell E1
Sub TransposeTest()
Dim oWs As Worksheet
Set oWs = ThisWorkbook.Worksheets("Sheet1")
With oWs
LastRow = .Cells(Rows.Count, "A").End(xlUp).Row
.Range("A1:A" & LastRow).Select
End With
' What about All the cells containing Apple
oWs.Range("E1") = Join(Application.transpose(Selection)) ' Output RESULT to Cell E1
End Sub
Am i able to do this without filtering the data or how is the best way to do this