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 :
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
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