Dear All,
I am working on an excel sheet which has 14 to 15 columns ofdata and I would like to copy some of the columns (according to the headername) and paste it to the next sheet. Sample below:
[TABLE="width: 449"]
<tbody>[TR]
[TD="width: 64"]Reviewed by
[/TD]
[TD="width: 84"]PACE[/TD]
[TD="width: 156"]Client Name [/TD]
[TD="width: 160"]Sub Engaging Parties[/TD]
[TD="width: 72"]DUNS Number[/TD]
[TD="width: 64"]GFIS Client ID[/TD]
[/TR]
[TR]
[TD="width: 64"]ABCD[/TD]
[TD="width: 84"]23200176[/TD]
[TD="width: 156"]ITWORX EUROPE LIMITED[/TD]
[TD="width: 160"]ITWORX LIMITED[/TD]
[TD="width: 72"]2783738[/TD]
[TD="width: 64"]6656[/TD]
[/TR]
[TR]
[TD="width: 64, bgcolor: transparent"]ABC[/TD]
[TD="width: 84, bgcolor: transparent"]23210789[/TD]
[TD="width: 156, bgcolor: transparent"]SPOTIFY LIMITED[/TD]
[TD="width: 160, bgcolor: transparent"]SPOTIFY LIMITED[/TD]
[TD="width: 72, bgcolor: transparent"][/TD]
[TD="width: 64, bgcolor: transparent"]39028[/TD]
[/TR]
[TR]
[TD="width: 64"]AB[/TD]
[TD="width: 84"]23210785[/TD]
[TD="width: 156"]SPOTIFY LIMITED[/TD]
[TD="width: 160"]SPOTIFY FINANCE [/TD]
[TD="width: 72"]673526[/TD]
[TD="width: 64"]7387[/TD]
[/TR]
</tbody>[/TABLE]
How the next sheet looks like:
[TABLE="width: 286"]
<tbody>[TR]
[TD="width: 74"]Reviewed by
[/TD]
[TD="width: 83"]PACE[/TD]
[TD="width: 154"]Client Name [/TD]
[TD="width: 71"]DUNS Number[/TD]
[/TR]
[TR]
[TD="width: 74"]
[/TD]
[TD="width: 83"]
[/TD]
[TD="width: 154"]
[/TD]
[TD="width: 71"]
[/TD]
[/TR]
[TR]
[TD="width: 74, bgcolor: transparent"]
[/TD]
[TD="width: 83, bgcolor: transparent"]
[/TD]
[TD="width: 154, bgcolor: transparent"]
[/TD]
[TD="width: 71, bgcolor: transparent"]
[/TD]
[/TR]
[TR]
[TD="width: 74"]
[/TD]
[TD="width: 83"]
[/TD]
[TD="width: 154"]
[/TD]
[TD="width: 71"]
[/TD]
[/TR]
</tbody>[/TABLE]
My problem is the data columns changes every day i.e nextday while pulling the report, client name and data which is in column C would comein column B or E. Hence, I cannot give static code to copy the data. Please seethe below code which was written:
WS1.Cells.Find(what:="Engagement Manager").Select
ActiveCell.Offset(1, 0).Select
FC = ActiveCell.Column
I have tried in different forum and I am new to VBA codingas well.
Please guide me to copy the data till the last row.
Warm Regards
Switto
I am working on an excel sheet which has 14 to 15 columns ofdata and I would like to copy some of the columns (according to the headername) and paste it to the next sheet. Sample below:
[TABLE="width: 449"]
<tbody>[TR]
[TD="width: 64"]Reviewed by
[/TD]
[TD="width: 84"]PACE[/TD]
[TD="width: 156"]Client Name [/TD]
[TD="width: 160"]Sub Engaging Parties[/TD]
[TD="width: 72"]DUNS Number[/TD]
[TD="width: 64"]GFIS Client ID[/TD]
[/TR]
[TR]
[TD="width: 64"]ABCD[/TD]
[TD="width: 84"]23200176[/TD]
[TD="width: 156"]ITWORX EUROPE LIMITED[/TD]
[TD="width: 160"]ITWORX LIMITED[/TD]
[TD="width: 72"]2783738[/TD]
[TD="width: 64"]6656[/TD]
[/TR]
[TR]
[TD="width: 64, bgcolor: transparent"]ABC[/TD]
[TD="width: 84, bgcolor: transparent"]23210789[/TD]
[TD="width: 156, bgcolor: transparent"]SPOTIFY LIMITED[/TD]
[TD="width: 160, bgcolor: transparent"]SPOTIFY LIMITED[/TD]
[TD="width: 72, bgcolor: transparent"][/TD]
[TD="width: 64, bgcolor: transparent"]39028[/TD]
[/TR]
[TR]
[TD="width: 64"]AB[/TD]
[TD="width: 84"]23210785[/TD]
[TD="width: 156"]SPOTIFY LIMITED[/TD]
[TD="width: 160"]SPOTIFY FINANCE [/TD]
[TD="width: 72"]673526[/TD]
[TD="width: 64"]7387[/TD]
[/TR]
</tbody>[/TABLE]
How the next sheet looks like:
[TABLE="width: 286"]
<tbody>[TR]
[TD="width: 74"]Reviewed by
[/TD]
[TD="width: 83"]PACE[/TD]
[TD="width: 154"]Client Name [/TD]
[TD="width: 71"]DUNS Number[/TD]
[/TR]
[TR]
[TD="width: 74"]
[/TD]
[TD="width: 83"]
[/TD]
[TD="width: 154"]
[/TD]
[TD="width: 71"]
[/TD]
[/TR]
[TR]
[TD="width: 74, bgcolor: transparent"]
[/TD]
[TD="width: 83, bgcolor: transparent"]
[/TD]
[TD="width: 154, bgcolor: transparent"]
[/TD]
[TD="width: 71, bgcolor: transparent"]
[/TD]
[/TR]
[TR]
[TD="width: 74"]
[/TD]
[TD="width: 83"]
[/TD]
[TD="width: 154"]
[/TD]
[TD="width: 71"]
[/TD]
[/TR]
</tbody>[/TABLE]
My problem is the data columns changes every day i.e nextday while pulling the report, client name and data which is in column C would comein column B or E. Hence, I cannot give static code to copy the data. Please seethe below code which was written:
WS1.Cells.Find(what:="Engagement Manager").Select
ActiveCell.Offset(1, 0).Select
FC = ActiveCell.Column
I have tried in different forum and I am new to VBA codingas well.
Please guide me to copy the data till the last row.
Warm Regards
Switto
Last edited by a moderator: