Pasting Values vertically instead of End of Blank Row

xlhelp15

Board Regular
Joined
Sep 12, 2014
Messages
116
Office Version
  1. 365
Platform
  1. Windows
  2. Mobile
  3. Web
Hi Everyone, Would need assistance on pasting selected columns value to combined tab. The below one is pasting values vertically where i would need it for every End of Row.

ID, Analyst & Column headers are unique fields in all the tabs which i have.

kindly assist.


VBA Code:
Sub CombineMySheets()
Dim J As Integer
Dim Rng As Long
Dim vHeader As Variant, rngFound As Range, i As Long
On Error Resume Next
Application.Calculation = xlCalculationManual
Sheets(1).Select
Worksheets.Add
Sheets(1).Name = "Combined"

For J = 2 To Sheets.Count
   
    Sheets(J).Activate
   
    For Each vHeader In Array("ID", "Analyst", "Comment")
        Set rngFound = Sheets(J).Cells.Find(vHeader, , xlValues, xlWhole, 1, 1, 0)
        i = i + 1
        If Not rngFound Is Nothing Then
            Range(rngFound, rngFound.End(xlDown)).Copy Destination:=Sheets(1).Cells(i, 1)
        End If
    Next
   
Next

Sheets("Combined").Activate
Columns.AutoFit
Application.Calculation = xlCalculationAutomatic
End Sub
VBA Code:
 

Excel Facts

Which Excel functions can ignore hidden rows?
The SUBTOTAL and AGGREGATE functions ignore hidden rows. AGGREGATE can also exclude error cells and more.

Forum statistics

Threads
1,224,823
Messages
6,181,181
Members
453,022
Latest member
Mohamed Magdi Tawfiq Emam

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