Create a formatted list/sheet from 2 other sheets

TXSpillard

New Member
Joined
Aug 30, 2016
Messages
1
Hi,

I tried searching for this even though it seems pretty easy, but it is quite tricky to describe and couldn't find anything..

I need to create a formatted excel from 2 sheets, one with data (DataSheet) and second with settings (SettingsSheet).
The Macro needs to loop per row into the Datasheet until a cell value of the list changes and do the following on the CreatedSheet:
-Set a header of concatenated values between DataSheet and DefaultSheet.
-For each row, set a concatenated value between DataSheet and DefaultSheet.
-Set a header of concatenated values between DataSheet and DefaultSheet.

And loop until the end of the sheet.

I imagine it will look like :

Code:
Dim rng As Range, cell As Range
Set rng = Range ("A1:A1048576")

For Each cell in rng
   //Check if previous cell from column A has a different value of current
   If DataSheet'A cell <> DataSheet'previousCell
      //If it has a different value, it will have to set a header row
      Range("CreatedSheet|NextCell").EntireRow.Insert = SettingsSheet'!$A$3&"Some header TXT"&DataSheet'A:cell&DataSheet'B:cell
   EndIf

   //We then want to set a formatted value for the row
   Range("CreatedSheet|NextCell").EntireRow.Insert = SettingsSheet'!$G$5&"Some body TXT"&DataSheet'cell

   //Check if next cell from column A has a different value of current
   If DataSheet'A cell <> DataSheet'NextCell
      //If it has a different value, it will have to set a footer row
      Range("CreatedSheet|NextCell").EntireRow.Insert = SettingsSheet'!$A$3&"Some header TXT"&DataSheet'D:cell&DataSheet'E:cell
   EndIf
Next cell

I think it is going to be tricky due to the header and footer that will create an offset of rows.
Have you any idea ? where could I find essential knowledge to be able to perform this ?

Many thanks in advance,
Thomas
 

Excel Facts

How to calculate loan payments in Excel?
Use the PMT function: =PMT(5%/12,60,-25000) is for a $25,000 loan, 5% annual interest, 60 month loan.

Forum statistics

Threads
1,215,372
Messages
6,124,541
Members
449,169
Latest member
mm424

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