Attached is a sample copy of raw data.
Source is present in Sheet1.
Desired output is shown in Sheet1.
Desired output should be produced by removing all the source data in Sheet1.
Thank you in advance.
Attached is a sample copy of raw data.
Source is present in Sheet1.
Desired output is shown in Sheet1.
Desired output should be produced by removing all the source data in Sheet1.
Thank you in advance.
As a courtesy to other members, please detail your question IN your thread, so that members dont need to open a file to see what you want
1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
2. If your question is resolved, mark it SOLVED using the thread tools
3. Click on the star if you think someone helped you
Regards
Ford
cell values of Multiple columns and rows have to be combined
Last edited by macrolearnerkk; 10-02-2015 at 07:04 AM.
Does this help?
![]()
Sub macrolearnerkk() Dim i As Long, x As String For i = 1 To Range("D" & Rows.Count).End(3).row If Cells(i, "B") <> "" Then x = Cells(i, "B") & " " & Cells(i + 2, "D") & " " & Cells(i + 1, "C") Range("F" & Rows.Count).End(3)(2) = x End If Next i End Sub
Simply awesome !!
Could you also please look at the following !
Sample attached
Last edited by macrolearnerkk; 10-02-2015 at 06:55 AM.
Perhaps:
![]()
Sub macrolearnerkk() Dim i As Long, x As String, y As Long y = ActiveSheet.UsedRange.Columns.Count + 1 For i = 2 To Range("A" & Rows.Count).End(3).row If Cells(i, "D") <> "" And Cells(i + 2, "F") <> "" And Cells(i + 1, "E") <> "" Then x = Cells(i, "D") & " " & Cells(i + 2, "F") & " " & Cells(i + 1, "E") Cells(Rows.Count, y).End(3)(2) = x End If If Cells(i, "D") <> "" And Cells(i + 2, "F") = "" Then x = Cells(i, "D") & " " & Cells(i + 1, "E") Cells(Rows.Count, y).End(3)(2) = x End If If Cells(i, "D") <> "" And Cells(i + 1, "E") = "" Then x = Cells(i, "D") & " " & Cells(i + 2, "F") Cells(Rows.Count, y).End(3)(2) = x End If If Cells(i, "D") <> "" And Cells(i + 1, "E") = "" And Cells(i + 2, "F") = "" Then x = Cells(i, "D") Cells(Rows.Count, y).End(3)(2) = x End If If Cells(i, "K") <> "" And Cells(i + 2, "M") <> "" And Cells(i + 1, "L") <> "" Then x = Cells(i, "K") & " " & Cells(i + 2, "M") & " " & Cells(i + 1, "L") Cells(Rows.Count, y).End(3)(2) = x End If If Cells(i, "K") <> "" And Cells(i + 2, "M") = "" Then x = Cells(i, "K") & " " & Cells(i + 1, "L") Cells(Rows.Count, y).End(3)(2) = x End If If Cells(i, "K") <> "" And Cells(i + 1, "L") = "" Then x = Cells(i, "K") & " " & Cells(i + 2, "M") Cells(Rows.Count, y).End(3)(2) = x End If If Cells(i, "K") <> "" And Cells(i + 1, "L") = "" And Cells(i + 2, "M") = "" Then x = Cells(i, "K") Cells(Rows.Count, y).End(3)(2) = x End If If Cells(i, "E") <> "" And Cells(i + 1, "F") = "" And Cells(i - 1, "D") = "" Then x = Cells(i, "E") Cells(Rows.Count, y).End(3)(2) = x End If If Cells(i, "L") <> "" And Cells(i + 1, "M") = "" And Cells(i - 1, "K") = "" Then x = Cells(i, "L") Cells(Rows.Count, y).End(3)(2) = x End If Next i Range(Cells(1, 1), Cells(1, y - 3)).EntireColumn.Delete Columns(1).ClearContents Columns(2).ClearContents End Sub
Code looks great.
Once again, thank you for your help.
Last edited by macrolearnerkk; 10-02-2015 at 01:18 PM.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks