Three spreadsheets to become one

vintage36

Board Regular
Joined
Nov 29, 2011
Messages
56
I keep records of electricity, gas and water consumption, which at the moment are on individual spreadsheets. I want to create a functioning spreadsheet of three original sheets to contain those I first mentioned.

Copy and paste seems not to work, as each new item posted to the recipient sheet appears to remove the previous one. (?)

How should I go about this, please?
 

PCL

Well-known Member
Joined
Jul 15, 2008
Messages
1,345
Is the data layout the same in each worksheet ... : Same Header ?
 

PCL

Well-known Member
Joined
Jul 15, 2008
Messages
1,345
Perhaps next code
Code:
Option Explicit


Sub CompilData()
Const DstWsN = "Review"
Const OrgWsLst = "Data1,Data2,Data3"
Dim WsN
    For Each WsN In Split(OrgWsLst, ",")
        With Sheets(WsN)
            .UsedRange.Offset(1, 0).Copy Destination:=Sheets(DstWsN).Cells(Rows.Count, 1).End(3)(2)
        End With
    Next WsN
End Sub
Adjust Const DstWsN = "Review"
Code:
Const OrgWsLst = "Data1,Data2,Data3"
to your need
 
Last edited:

vintage36

Board Regular
Joined
Nov 29, 2011
Messages
56
Is the data layout the same in each worksheet ... : Same Header ?
The worksheets do not have headers.
The layouts will differ, because the information required for each is slightly different. The column names will vary as well.
 

vintage36

Board Regular
Joined
Nov 29, 2011
Messages
56
Also the code entries are not understood. What does each line mean or do, please? What goes in for Data1, Data2, Data3?
 

PCL

Well-known Member
Joined
Jul 15, 2008
Messages
1,345
Data1, Data2, Data3
is the name of the input sheets and you have to custom them with yours names.
The layouts will differ, because the information required for each is slightly different. The column names will vary as well.

Without more information it is not possible to prepare a macro

The worksheets do not have headers.
So how to align the data ???

 
Last edited:

PCL

Well-known Member
Joined
Jul 15, 2008
Messages
1,345
You are the one with the Pb ...!
We can wait.
 

Forum statistics

Threads
1,081,901
Messages
5,361,937
Members
400,666
Latest member
UDLearning

Some videos you may like

This Week's Hot Topics

  • populate from drop list with multiple tables
    Hi All, i have a drop list that displays data, what i want is when i select one of those from the list to populate text from different tables on...
  • Find list of words from sheet2 in sheet1 before a comma and extract text vba
    Hi Friends, Trying to find the solution on my task. But did not find suitable one to the need. Here is my query and sample file with details...
  • Dynamic Formula entry - VBA code sought
    Hello, really hope one of you experts can help with this - i've spent hours on this and getting no-where. .I have a set of data (more rows than...
  • Listbox Header
    Have a named range called "AccidentsHeader" Within my code I have: [CODE]Private Sub CommandButton1_Click() ListBox1.RowSource =...
  • Complex Heat Map using conditional formatting
    Good day excel world. I have a concern. Below link have a list of countries that carries each country unique data. [URL...
  • Conditional formatting
    Hi good morning, hope you can help me please, I have cells P4:P54 and if this cell is equal to 1 then i want row O to say "Fully Utilised" and to...
Top