Merge Multiple column from different sheet and highlight the row with unique value.

anu_gv

Board Regular
Joined
Sep 11, 2015
Messages
62
Hi,

I have multiple sheet in given workbook. Each sheet filled with Column A:E with same number of rows. I would like to combine all these sheets into one sheet and highlight the row for the column header named as "Order" with "Yes" option.

Sheet1

S.NoOrderNameFull NameAddress
1YesAlexAlex BBBBB12, xxxxxx St
2NoBenBen CCCCC25, yyyyy st
3NoBrianBrian DDDDD44, zzzzz Dr,
4YesCharlieCharlie EEEE45, jjjjjjj Blvd
5YesDanDan GGGGGG89, abc Dr,

<colgroup><col span="3"><col><col></colgroup><tbody>
</tbody>
















Sheet2

S.NoOrderNameFull NameAddress
1NoAlexAlex BBBBB12, xxxxxx St
2YesBenBen CCCCC25, yyyyy st
3NoBrianBrian DDDDD44, zzzzz Dr,
4YesCharlieCharlie EEEE45, jjjjjjj Blvd
5NoDanDan GGGGGG89, abc Dr,

<colgroup><col span="3"><col><col></colgroup><tbody>
</tbody>
















Sheet3

S.NoOrderNameFull NameAddress
1YesAlexAlex BBBBB12, xxxxxx St
2YesBenBen CCCCC25, yyyyy st
3YesBrianBrian DDDDD44, zzzzz Dr,
4NoCharlieCharlie EEEE45, jjjjjjj Blvd
5NoDanDan GGGGGG89, abc Dr,

<colgroup><col span="3"><col><col></colgroup><tbody>
</tbody>

Any help is really appreciated.

Thx
Anu.
 

Excel Facts

VLOOKUP to Left?
Use =VLOOKUP(A2,CHOOSE({1,2},$Z$1:$Z$99,$Y$1:$Y$99),2,False) to lookup Y values to left of Z values.
To All,

Any suggestion (or) previously any one encountered the same request. Please help me out.

Thx
Anu.
 
Upvote 0
Try
Code:
Sub CopyToNewSheet()

   Dim Ws As Worksheet
   Dim NewWs As Worksheet
   
   Sheets.Add(Sheets(1)).Name = "New"
   Set NewWs = ActiveSheet
   NewWs.Range("A1:E1").Value = Sheets(2).Range("A1:E1").Value
   For Each Ws In Worksheets
      If Ws.Name <> "New" Then
         Ws.UsedRange.Offset(1).Copy NewWs.Range("A" & Rows.Count).End(xlUp).Offset(1)
      End If
   Next Ws
   
   With NewWs.Range("B:B")
      .Replace "Yes", True, xlWhole, , False, , False, False
      .SpecialCells(xlConstants, xlLogical).Interior.Color = 123456
      .Replace True, "Yes", xlWhole, , False, , False, False
   End With
End Sub
This will create a new sheet called "New" & copy all the other sheets on to it.
 
Upvote 0
Thanks Fluff,
Instead of putting all the other sheet value in down in "New" sheet, is there a way to have it in columns such as "A,B,C,D,E", "J,K,L,M,N", "P,Q,R,S,T" from sheets - Sheet1, Sheet2, Sheet3 respectively in the "New" Sheet.

Thx
Anu.
 
Upvote 0
How about
Code:
Sub CopyToNewSheet()

   Dim Ws As Worksheet
   Dim NewWs As Worksheet
   Dim Col As Long
   
   Sheets.Add(Sheets(1)).Name = "New"
   Set NewWs = ActiveSheet
   Col = 1
   
   For Each Ws In Worksheets
      If Ws.Name <> "New" Then
         Ws.UsedRange.Copy NewWs.Cells(1, Col)
         Col = Col + 9
      End If
   Next Ws
   
   With NewWs
      For Col = 2 To .Cells(1, Columns.Count).End(xlToLeft).Column Step 9
         With .Columns(Col)
            .Replace "Yes", True, xlWhole, , False, , False, False
            On Error Resume Next
            .SpecialCells(xlConstants, xlLogical).Interior.Color = 123456
            On Error GoTo 0
            .Replace True, "Yes", xlWhole, , False, , False, False
         End With
      Next Col
   End With
End Sub
 
Upvote 0
Glad to help & thanks for the feedback
 
Upvote 0

Forum statistics

Threads
1,214,568
Messages
6,120,272
Members
448,953
Latest member
Dutchie_1

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top