We value your feedback.
Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!
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.
|does anyone has list of all excel features including the new ones added by 365?||1||19|
|Excel 2013 Find and copy duplicates to a new worksheet||6||37|
|Script/Formula to move data to another cell||6||22|
|Access Excel ADO SQL question||8||11|