Hi All,
I need help for the below activity. I am not well versed in Macros. Below is the scenario.
1. I have one Workbook, with two Worksheets named as; "People" & "Masterfile"
In People Worksheet the Data is as below:
[TABLE="width: 673"]
<tbody>[TR]
[TD][/TD]
[TD="align: center"]Column A
[/TD]
[TD="align: center"]Column B
[/TD]
[TD="align: center"]Column C
[/TD]
[TD="align: center"]Column D
[/TD]
[TD="align: center"]Column E
[/TD]
[TD="align: center"]Column F
[/TD]
[/TR]
[TR]
[TD="align: center"]Row 1
[/TD]
[TD="align: center"]Reg No.
[/TD]
[TD="align: center"]Name
[/TD]
[TD="align: center"]Credit
[/TD]
[TD="align: center"]Debit
[/TD]
[TD="align: center"]Reason
[/TD]
[TD="align: center"]Week Nos.
[/TD]
[/TR]
[TR]
[TD="align: center"]Row 2
[/TD]
[TD="align: center"]1
[/TD]
[TD="align: center"]Ajay
[/TD]
[TD="align: center"]10
[/TD]
[TD="align: center"][/TD]
[TD="align: center"]To buy stationary
[/TD]
[TD="align: center"]5
[/TD]
[/TR]
[TR]
[TD="align: center"]Row 3
[/TD]
[TD="align: center"]2
[/TD]
[TD="align: center"]Vijay
[/TD]
[TD="align: center"]30
[/TD]
[TD="align: center"][/TD]
[TD="align: center"]To buy stationary
[/TD]
[TD="align: center"]5
[/TD]
[/TR]
[TR]
[TD="align: center"]Row 4
[/TD]
[TD="align: center"]3
[/TD]
[TD="align: center"]Sujay
[/TD]
[TD="align: center"][/TD]
[TD="align: center"]50
[/TD]
[TD="align: center"]Paid back pending
[/TD]
[TD="align: center"]5
[/TD]
[/TR]
[TR]
[TD="align: center"]Row 5
[/TD]
[TD="align: center"]4
[/TD]
[TD="align: center"]Ajay
[/TD]
[TD="align: center"]40
[/TD]
[TD="align: center"][/TD]
[TD="align: center"]Paid for transport
[/TD]
[TD="align: center"]6
[/TD]
[/TR]
</tbody>[/TABLE]
Masterfile worksheet has following data:
[TABLE="width: 420"]
<tbody>[TR]
[TD][/TD]
[TD="align: center"]Column A
[/TD]
[TD="align: center"]Column B
[/TD]
[TD="align: center"]Column C
[/TD]
[TD="align: center"]Column D
[/TD]
[/TR]
[TR]
[TD="align: center"]Row 1
[/TD]
[TD="align: center"]Name
[/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[/TR]
[TR]
[TD="align: center"]Row 2
[/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[/TR]
[TR]
[TD="align: center"]Row 3
[/TD]
[TD="align: center"]Transactions Reason
[/TD]
[TD="align: center"]Week Nos.
[/TD]
[TD="align: center"]Debit
[/TD]
[TD="align: center"]Creadit
[/TD]
[/TR]
[TR]
[TD="align: center"]Row 4
[/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[/TR]
[TR]
[TD="align: center"]Row 5
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
The Macro should
1. Create number of "Masterfile" worksheets based on the number of Names in the "People" worksheet, and rename the worksheet with the name, but if already created, then do not create again.
For Example: Worksheets by Name: "Ajay", "Vijay", "Sujay"
2. In the Worksheet "Ajay", the details of Name, Transaction Reason, Week Nos., Debit, Credit, should be filled corresponding to the Data in the "People" Worksheet. For Example:
[TABLE="width: 420"]
<tbody>[TR]
[TD][/TD]
[TD="align: center"]Column A
[/TD]
[TD="align: center"]Column B
[/TD]
[TD="align: center"]Column C
[/TD]
[TD="align: center"]Column D
[/TD]
[/TR]
[TR]
[TD="align: center"]Row 1
[/TD]
[TD="align: center"]Name
[/TD]
[TD="align: center"]Ajay
[/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[/TR]
[TR]
[TD="align: center"]Row 2
[/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[/TR]
[TR]
[TD="align: center"]Row 3
[/TD]
[TD="align: center"]Transactions Reason
[/TD]
[TD="align: center"]Week Nos.
[/TD]
[TD="align: center"]Debit
[/TD]
[TD="align: center"]Creadit
[/TD]
[/TR]
[TR]
[TD="align: center"]Row 4
[/TD]
[TD="align: center"]To buy stationary
[/TD]
[TD="align: center"]5
[/TD]
[TD="align: center"][/TD]
[TD="align: center"]10
[/TD]
[/TR]
[TR]
[TD="align: center"]Row 5
[/TD]
[TD="align: center"]Paid for transport
[/TD]
[TD="align: center"]6[/TD]
[TD][/TD]
[TD="align: center"]40[/TD]
[/TR]
</tbody>[/TABLE]
3. Similarly in other worksheets of Vijay and Sujay.
I hope somebody helps at the earliest.
Thanks in Advance.
I need help for the below activity. I am not well versed in Macros. Below is the scenario.
1. I have one Workbook, with two Worksheets named as; "People" & "Masterfile"
In People Worksheet the Data is as below:
[TABLE="width: 673"]
<tbody>[TR]
[TD][/TD]
[TD="align: center"]Column A
[/TD]
[TD="align: center"]Column B
[/TD]
[TD="align: center"]Column C
[/TD]
[TD="align: center"]Column D
[/TD]
[TD="align: center"]Column E
[/TD]
[TD="align: center"]Column F
[/TD]
[/TR]
[TR]
[TD="align: center"]Row 1
[/TD]
[TD="align: center"]Reg No.
[/TD]
[TD="align: center"]Name
[/TD]
[TD="align: center"]Credit
[/TD]
[TD="align: center"]Debit
[/TD]
[TD="align: center"]Reason
[/TD]
[TD="align: center"]Week Nos.
[/TD]
[/TR]
[TR]
[TD="align: center"]Row 2
[/TD]
[TD="align: center"]1
[/TD]
[TD="align: center"]Ajay
[/TD]
[TD="align: center"]10
[/TD]
[TD="align: center"][/TD]
[TD="align: center"]To buy stationary
[/TD]
[TD="align: center"]5
[/TD]
[/TR]
[TR]
[TD="align: center"]Row 3
[/TD]
[TD="align: center"]2
[/TD]
[TD="align: center"]Vijay
[/TD]
[TD="align: center"]30
[/TD]
[TD="align: center"][/TD]
[TD="align: center"]To buy stationary
[/TD]
[TD="align: center"]5
[/TD]
[/TR]
[TR]
[TD="align: center"]Row 4
[/TD]
[TD="align: center"]3
[/TD]
[TD="align: center"]Sujay
[/TD]
[TD="align: center"][/TD]
[TD="align: center"]50
[/TD]
[TD="align: center"]Paid back pending
[/TD]
[TD="align: center"]5
[/TD]
[/TR]
[TR]
[TD="align: center"]Row 5
[/TD]
[TD="align: center"]4
[/TD]
[TD="align: center"]Ajay
[/TD]
[TD="align: center"]40
[/TD]
[TD="align: center"][/TD]
[TD="align: center"]Paid for transport
[/TD]
[TD="align: center"]6
[/TD]
[/TR]
</tbody>[/TABLE]
Masterfile worksheet has following data:
[TABLE="width: 420"]
<tbody>[TR]
[TD][/TD]
[TD="align: center"]Column A
[/TD]
[TD="align: center"]Column B
[/TD]
[TD="align: center"]Column C
[/TD]
[TD="align: center"]Column D
[/TD]
[/TR]
[TR]
[TD="align: center"]Row 1
[/TD]
[TD="align: center"]Name
[/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[/TR]
[TR]
[TD="align: center"]Row 2
[/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[/TR]
[TR]
[TD="align: center"]Row 3
[/TD]
[TD="align: center"]Transactions Reason
[/TD]
[TD="align: center"]Week Nos.
[/TD]
[TD="align: center"]Debit
[/TD]
[TD="align: center"]Creadit
[/TD]
[/TR]
[TR]
[TD="align: center"]Row 4
[/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[/TR]
[TR]
[TD="align: center"]Row 5
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
The Macro should
1. Create number of "Masterfile" worksheets based on the number of Names in the "People" worksheet, and rename the worksheet with the name, but if already created, then do not create again.
For Example: Worksheets by Name: "Ajay", "Vijay", "Sujay"
2. In the Worksheet "Ajay", the details of Name, Transaction Reason, Week Nos., Debit, Credit, should be filled corresponding to the Data in the "People" Worksheet. For Example:
[TABLE="width: 420"]
<tbody>[TR]
[TD][/TD]
[TD="align: center"]Column A
[/TD]
[TD="align: center"]Column B
[/TD]
[TD="align: center"]Column C
[/TD]
[TD="align: center"]Column D
[/TD]
[/TR]
[TR]
[TD="align: center"]Row 1
[/TD]
[TD="align: center"]Name
[/TD]
[TD="align: center"]Ajay
[/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[/TR]
[TR]
[TD="align: center"]Row 2
[/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[/TR]
[TR]
[TD="align: center"]Row 3
[/TD]
[TD="align: center"]Transactions Reason
[/TD]
[TD="align: center"]Week Nos.
[/TD]
[TD="align: center"]Debit
[/TD]
[TD="align: center"]Creadit
[/TD]
[/TR]
[TR]
[TD="align: center"]Row 4
[/TD]
[TD="align: center"]To buy stationary
[/TD]
[TD="align: center"]5
[/TD]
[TD="align: center"][/TD]
[TD="align: center"]10
[/TD]
[/TR]
[TR]
[TD="align: center"]Row 5
[/TD]
[TD="align: center"]Paid for transport
[/TD]
[TD="align: center"]6[/TD]
[TD][/TD]
[TD="align: center"]40[/TD]
[/TR]
</tbody>[/TABLE]
3. Similarly in other worksheets of Vijay and Sujay.
I hope somebody helps at the earliest.
Thanks in Advance.