Learn how to provision tenants, synchronize on-premise Active Directory, implement Single Sign-On, customize Office deployment, and protect your organization with eDiscovery and DLP policies. Only from Platform Scholar.
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
Add your voice to the tech community where 5M+ people just like you are talking about what matters.
Join the community of 500,000 technology professionals and ask your questions.