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,317
Is the data layout the same in each worksheet ... : Same Header ?
 

PCL

Well-known Member
Joined
Jul 15, 2008
Messages
1,317
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,317
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,317
You are the one with the Pb ...!
We can wait.
 

Forum statistics

Threads
1,077,920
Messages
5,337,196
Members
399,131
Latest member
Vinnyjuice

Some videos you may like

This Week's Hot Topics

Top