vba consolidation - copying multiple sheets data and pasting in different Sheet

Mallesh23

Well-known Member
Joined
Feb 4, 2009
Messages
976
Office Version
  1. 2010
Platform
  1. Windows
Code:
Hi Team,


I want to consolidate DailyCount data 
 (i.e Daily Dataworkbooks specific sheetsData into masterworkbooks specific sheets)

There are multiple sheets in DailyDataworkbook and Masterworkbook I have reduced few of them.


Below are my attempted code not accurate. plz assist.


Sub Consolidation_Data()


Dim DataLr As Long
Dim wbk As ThisWorkbook
Dim Datawbk As Workbook
Dim Masterwbk As Workbook


Set wbk = ThisWorkbook
Set Datawbk = Workbooks.Open(wbk.Worksheets("Sheet1").Range("D5").Value, ReadOnly:=True)
Set Masterwbk = Workbooks.Open(wbk.Worksheets("Sheet1").Range("D7").Value, ReadOnly:=True)


Dim Dataws As Worksheet
Dim shtn As Worksheet


For Each Dataws In Datawbk.Worksheets
    Select Case Dataws.Name
     Case "OutgoingCall", "IncomingCall", "CallReview"
   DataLr = Dataws.Range("a1").CurrentRegion.Rows.Count
    
    Dataws.Activate
    If DataLr > 1 Then
      Dataws.Range("a1").CurrentRegion.Offset(1).Copy
      For Each shtn In Array("Outgoing", "Incoming", "Review")
          Masterwbk.Sheets(shtn).Cells(Rows.Count, 1).End(xlUp).Offset(1).PasteSpecial:= xlPasteValues
    Next
  Else
   
    Exit For
   End Select
Next
End Sub

Thanks in Advance !

Regards,
Mallesh
 

Excel Facts

Spell Check in Excel
Press F7 to start spell check in Excel. Be careful, by default, Excel does not check Capitalized Werds (whoops)

Forum statistics

Threads
1,216,098
Messages
6,128,812
Members
449,468
Latest member
AGreen17

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