Download this FREE eBook and learn all you need to get started with Windows Nano Server, including deployment options, remote management
and troubleshooting tips and tricks
Sub Transposedata() Dim strNotes As String Dim r As Integer, c As Integer Dim intMax As Integer intMax = LastRow(ActiveSheet) For r = 2 To intMax Step 1 For c = 28 To 30 Step 1 strNotes = IIf(c = 28, ActiveSheet.Cells(r, c).Value, strNotes & strRepeat(vbCrLf, 2) & ActiveSheet.Cells(r, c).Value) Next c ActiveSheet.Cells(r, 26).Value = strNotes Next r MsgBox "Done!" End Sub Function LastRow(ws As Worksheet) As Single 'uses worksheet object 'returns last used row On Error Resume Next With ws LastRow = .Cells.Find(What:="*", _ SearchDirection:=xlPrevious, _ SearchOrder:=xlByRows).Row End With End Function Function strRepeat(str As String, cnt As Integer) As String For i = 1 To cnt str = str & str Next i End Function
Join the community of 500,000 technology professionals and ask your questions.