Trying to consolidate data from several sheets into one

Ivn68

Board Regular
Joined
Aug 21, 2015
Messages
82
Need to run a loop that takes data from one sheet and put the data onto another.

Sooo on the new sheet

C3=B5
D3=C5
E3=D5
F3=E5

C4=H5
D4=I5
E4=J5
F4=K5

C5=N5
D5=O5
E5=P5
F5=Q5

...

C16=CN5
D16=CO5
E16=CP5
F16=CQ5

Left hand side is new sheet and right hand side is like worksheet1

All in the same workbook

Any help would be greatly appreciated
 
Last edited:

Excel Facts

Difference between two dates
Secret function! Use =DATEDIF(A2,B2,"Y")&" years"&=DATEDIF(A2,B2,"YM")&" months"&=DATEDIF(A2,B2,"MD")&" days"
The basic code to do that:
C3=B5
Code:
Sheets("SheetName2").Range("C3").Value = [/COLOR][COLOR=#333333]Sheets("SheetName1").Range("B5").Value[/COLOR][COLOR=#333333]
[/COLOR]

 
Last edited:
Upvote 0
There is a lot of data want to try to run a loop
To move all the data to one sheet
 
Upvote 0
I am not sure if a loop is what you need. It would be better if I can take a look at your workbook and see whats inside.. try to upload the file or a screenshot
 
Upvote 0
Sheets("CD").range(cells(2+x,3+x)).value=sheets("pit 1").range(cells(5,2+x6)).value

I get application defined or object defined error
 
Upvote 0
That's not a proper reference. You don't really need a loop, but maybe something like this:

Code:
Sub ThisCode()
Dim Sht1 As Worksheet
Dim Sht2 As Worksheet
    Set Sht1 = Sheets("Pit 1")
    Set Sht2 = Sheets("CD")


    With Sht2
        .Range("C3").Value = Sht1.Range("B5").Value
        .Range("D3").Value = Sht1.Range("C5").Value
        .Range("E3").Value = Sht1.Range("D5").Value
        .Range("F3").Value = Sht1.Range("E5").Value
        'keep going here (copy and paste, then manually adjust the cells)
    End With
End Sub
 
Upvote 0
Another option is like
Code:
Sub copyVal()
   Sheets("Sheet2").Range("C3:F3").Value = Sheets("Sheet1").Range("B5:E5").Value
   Sheets("Sheet2").Range("C4:F4").Value = Sheets("Sheet1").Range("H5:K5").Value
End Sub
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,177
Members
453,021
Latest member
Justyna P

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