Hello,
What I am trying to do is copy a "Set" of data from one workbook ("SourceWorkbook") to another workbook that contains an invoice template sheet ("TargetWorkbook").
I will now define what I believe is necessary in order to understand what I am trying to accomplish.
SourceWorkbook - Contains a single sheet with data. There are 7 columns. Name, Account #, Value, Billing Date, Billing Period, Fee, % Fee. The data is sorted by Column labeled name. The Data contains what I refer to as a Set which needs to be copied to the TargetWorkBook on a a new sheet ( one sheet per set) and said sheet should have the copy and pasted Values, forumas, formates (ALL) of the contents in the TemplateSheet found in the TargetWorkBook.
Set - The set refers to the data that would to to copy from the SourceWorkbook to the TargetWorkbook. A set can be a single row or multiple rows ( row number is dynamic and need to be "Looked For") . The columns in the set will always be the Range A to C. What defines the Row Range of the set is that the values of Column A the same. Once Column A is different from the previous cell value of Column A then there is a new Set, Which implies that a new sheet needs to be created on the TargetWorkBook and that sheet should have the contents of the TemplateSheet copied into it and that set should be copy and pasted on to the new sheet starting on cell A17.
Worded differently, what I believe is most difficult is having the macro find the set. It has to recognize that the value from the previous cell in column A is different and then look for the same values of that different set. Meaning, find all the duplicate values of column A, and there may be non if there is only one account per name, and then select all the duplicate values ( rows depend on the number of duplicate values and columns, again, will always be A to C) and be ready to copy them to the new sheet etc.
TemplateSheet -a sheet inside the TargetWorkbook which is copied onto a new sheet ( and a new sheet is created when there is a new set).
The macro ends once there is a blank cell in Columns A.
Examples: SorceWorkbook Data
[TABLE="width: 320"]
<tbody>[TR]
[TD]Name
[/TD]
[TD]Account
[/TD]
[TD]Billable Value
[/TD]
[TD]Bill Date
[/TD]
[TD]Bill Period
[/TD]
[/TR]
[TR]
[TD]Tim
[/TD]
[TD]111
[/TD]
[TD]10.00
[/TD]
[TD]17-Jun
[/TD]
[TD]05/01/17-05/31/17
[/TD]
[/TR]
[TR]
[TD]Tod
[/TD]
[TD]112
[/TD]
[TD]10.00
[/TD]
[TD]17-Jun
[/TD]
[TD]05/01/17-05/31/17
[/TD]
[/TR]
[TR]
[TD]Tod
[/TD]
[TD]113
[/TD]
[TD]10.00
[/TD]
[TD]17-Jun
[/TD]
[TD]05/01/17-05/31/17
[/TD]
[/TR]
[TR]
[TD]Tod
[/TD]
[TD]114
[/TD]
[TD]10.00
[/TD]
[TD]17-Jun
[/TD]
[TD]05/01/17-05/31/17
[/TD]
[/TR]
[TR]
[TD]Kim
[/TD]
[TD]115
[/TD]
[TD]10.00
[/TD]
[TD]17-Jun
[/TD]
[TD]05/01/17-05/31/17
[/TD]
[/TR]
[TR]
[TD]Kim
[/TD]
[TD]116
[/TD]
[TD]10.00
[/TD]
[TD]17-Jun
[/TD]
[TD]05/01/17-05/31/17
[/TD]
[/TR]
</tbody>[/TABLE]
Example of a sets in this data:
Set 1:
[TABLE="width: 320"]
<tbody>[TR]
[TD]Tim
[/TD]
[TD]111
[/TD]
[TD]10.00
[/TD]
[TD]17-Jun
[/TD]
[TD]05/01/17-05/31/17
[/TD]
[/TR]
</tbody>[/TABLE]
Set 2:
[TABLE="width: 320"]
<tbody>[TR]
[TD]Tod
[/TD]
[TD]112
[/TD]
[TD]10.00
[/TD]
[TD]17-Jun
[/TD]
[TD]05/01/17-05/31/17
[/TD]
[/TR]
[TR]
[TD]Tod
[/TD]
[TD]113
[/TD]
[TD]10.00
[/TD]
[TD]17-Jun
[/TD]
[TD]05/01/17-05/31/17
[/TD]
[/TR]
[TR]
[TD]Tod
[/TD]
[TD]114
[/TD]
[TD]10.00
[/TD]
[TD]17-Jun
[/TD]
[TD]05/01/17-05/31/17
[/TD]
[/TR]
</tbody>[/TABLE]
Set 3:
[TABLE="width: 320"]
<tbody>[TR]
[TD]Kim
[/TD]
[TD]115
[/TD]
[TD]10.00
[/TD]
[TD]17-Jun
[/TD]
[TD]05/01/17-05/31/17
[/TD]
[/TR]
[TR]
[TD]Kim
[/TD]
[TD]116
[/TD]
[TD]10.00
[/TD]
[TD]17-Jun
[/TD]
[TD]05/01/17-05/31/17
[/TD]
[/TR]
</tbody>[/TABLE]
Now this set need to be copy and pasted into Cell A17 of a new sheet in the TargetWorkBook and the new sheet needs to have the copy and pasted (all) of the TemplateSheet in it.
This repeated until there is no more data.
Thank you and let me know if I need to provide any additional information.
What I am trying to do is copy a "Set" of data from one workbook ("SourceWorkbook") to another workbook that contains an invoice template sheet ("TargetWorkbook").
I will now define what I believe is necessary in order to understand what I am trying to accomplish.
SourceWorkbook - Contains a single sheet with data. There are 7 columns. Name, Account #, Value, Billing Date, Billing Period, Fee, % Fee. The data is sorted by Column labeled name. The Data contains what I refer to as a Set which needs to be copied to the TargetWorkBook on a a new sheet ( one sheet per set) and said sheet should have the copy and pasted Values, forumas, formates (ALL) of the contents in the TemplateSheet found in the TargetWorkBook.
Set - The set refers to the data that would to to copy from the SourceWorkbook to the TargetWorkbook. A set can be a single row or multiple rows ( row number is dynamic and need to be "Looked For") . The columns in the set will always be the Range A to C. What defines the Row Range of the set is that the values of Column A the same. Once Column A is different from the previous cell value of Column A then there is a new Set, Which implies that a new sheet needs to be created on the TargetWorkBook and that sheet should have the contents of the TemplateSheet copied into it and that set should be copy and pasted on to the new sheet starting on cell A17.
Worded differently, what I believe is most difficult is having the macro find the set. It has to recognize that the value from the previous cell in column A is different and then look for the same values of that different set. Meaning, find all the duplicate values of column A, and there may be non if there is only one account per name, and then select all the duplicate values ( rows depend on the number of duplicate values and columns, again, will always be A to C) and be ready to copy them to the new sheet etc.
TemplateSheet -a sheet inside the TargetWorkbook which is copied onto a new sheet ( and a new sheet is created when there is a new set).
The macro ends once there is a blank cell in Columns A.
Examples: SorceWorkbook Data
[TABLE="width: 320"]
<tbody>[TR]
[TD]Name
[/TD]
[TD]Account
[/TD]
[TD]Billable Value
[/TD]
[TD]Bill Date
[/TD]
[TD]Bill Period
[/TD]
[/TR]
[TR]
[TD]Tim
[/TD]
[TD]111
[/TD]
[TD]10.00
[/TD]
[TD]17-Jun
[/TD]
[TD]05/01/17-05/31/17
[/TD]
[/TR]
[TR]
[TD]Tod
[/TD]
[TD]112
[/TD]
[TD]10.00
[/TD]
[TD]17-Jun
[/TD]
[TD]05/01/17-05/31/17
[/TD]
[/TR]
[TR]
[TD]Tod
[/TD]
[TD]113
[/TD]
[TD]10.00
[/TD]
[TD]17-Jun
[/TD]
[TD]05/01/17-05/31/17
[/TD]
[/TR]
[TR]
[TD]Tod
[/TD]
[TD]114
[/TD]
[TD]10.00
[/TD]
[TD]17-Jun
[/TD]
[TD]05/01/17-05/31/17
[/TD]
[/TR]
[TR]
[TD]Kim
[/TD]
[TD]115
[/TD]
[TD]10.00
[/TD]
[TD]17-Jun
[/TD]
[TD]05/01/17-05/31/17
[/TD]
[/TR]
[TR]
[TD]Kim
[/TD]
[TD]116
[/TD]
[TD]10.00
[/TD]
[TD]17-Jun
[/TD]
[TD]05/01/17-05/31/17
[/TD]
[/TR]
</tbody>[/TABLE]
Example of a sets in this data:
Set 1:
[TABLE="width: 320"]
<tbody>[TR]
[TD]Tim
[/TD]
[TD]111
[/TD]
[TD]10.00
[/TD]
[TD]17-Jun
[/TD]
[TD]05/01/17-05/31/17
[/TD]
[/TR]
</tbody>[/TABLE]
Set 2:
[TABLE="width: 320"]
<tbody>[TR]
[TD]Tod
[/TD]
[TD]112
[/TD]
[TD]10.00
[/TD]
[TD]17-Jun
[/TD]
[TD]05/01/17-05/31/17
[/TD]
[/TR]
[TR]
[TD]Tod
[/TD]
[TD]113
[/TD]
[TD]10.00
[/TD]
[TD]17-Jun
[/TD]
[TD]05/01/17-05/31/17
[/TD]
[/TR]
[TR]
[TD]Tod
[/TD]
[TD]114
[/TD]
[TD]10.00
[/TD]
[TD]17-Jun
[/TD]
[TD]05/01/17-05/31/17
[/TD]
[/TR]
</tbody>[/TABLE]
Set 3:
[TABLE="width: 320"]
<tbody>[TR]
[TD]Kim
[/TD]
[TD]115
[/TD]
[TD]10.00
[/TD]
[TD]17-Jun
[/TD]
[TD]05/01/17-05/31/17
[/TD]
[/TR]
[TR]
[TD]Kim
[/TD]
[TD]116
[/TD]
[TD]10.00
[/TD]
[TD]17-Jun
[/TD]
[TD]05/01/17-05/31/17
[/TD]
[/TR]
</tbody>[/TABLE]
Now this set need to be copy and pasted into Cell A17 of a new sheet in the TargetWorkBook and the new sheet needs to have the copy and pasted (all) of the TemplateSheet in it.
This repeated until there is no more data.
Thank you and let me know if I need to provide any additional information.