squallvlad
01-11-2011, 11:09 PM
Hello all,
It is my first time on this forum. I need help creating a macro and I realized after some research I canīt do it on my own.
So maybe somebody can help me with this macro.
What I need :
I have a workbook were I put usually different data but in the exact same cells.
I will call it HomeWB.
So, I want to copy this data's to another workbook (let's call it SecondWB), and this data should be organize by sheets. The sheets will be named as the cell C12 from HomeWB.
So I need a macro that search from the HomeWB - C12 cell and identifies the sheet on the SecondWB. Make it active and then select the last empty row and copy some different cell from the HomeWB.
Exempale Copy the cells C9, G9, G32 from HomeWB in to SecondWB B1, B2, B3.
Since I was thinking to put this formula in A1 that excel finds the worksheet name :
=MID(CELL("filename";$A$1);FIND("]";CELL("filename";$A$1);1)+1;LEN(CELL("filename";$A$1))-FIND("]";CELL("filename";$A$1);1))
So actually after finding this A1 value from HomeWB C12 value, it has to make the A1 cell active, and then identify the last cell free from A column make it active and copy the values.
If C12 will not be find in the SecondWB than create a new sheet with C12 name, copy the formula (=MID(CELL("filename";$A$1);FIND("]";CELL("filename";$A$1);1)+1;LEN(CELL("filename";$A$1))-FIND("]";CELL("filename";$A$1);1))) in A1, and then the values.
Can somebody help me with this macro ?
I have nothing until now. Actually I have some code parts that I can't combine.
If it is possible I would like also that the macro contain a line to open SecondWB if it isn't opened, and after copying the values to save it and close it.
Thank you in advance
It is my first time on this forum. I need help creating a macro and I realized after some research I canīt do it on my own.
So maybe somebody can help me with this macro.
What I need :
I have a workbook were I put usually different data but in the exact same cells.
I will call it HomeWB.
So, I want to copy this data's to another workbook (let's call it SecondWB), and this data should be organize by sheets. The sheets will be named as the cell C12 from HomeWB.
So I need a macro that search from the HomeWB - C12 cell and identifies the sheet on the SecondWB. Make it active and then select the last empty row and copy some different cell from the HomeWB.
Exempale Copy the cells C9, G9, G32 from HomeWB in to SecondWB B1, B2, B3.
Since I was thinking to put this formula in A1 that excel finds the worksheet name :
=MID(CELL("filename";$A$1);FIND("]";CELL("filename";$A$1);1)+1;LEN(CELL("filename";$A$1))-FIND("]";CELL("filename";$A$1);1))
So actually after finding this A1 value from HomeWB C12 value, it has to make the A1 cell active, and then identify the last cell free from A column make it active and copy the values.
If C12 will not be find in the SecondWB than create a new sheet with C12 name, copy the formula (=MID(CELL("filename";$A$1);FIND("]";CELL("filename";$A$1);1)+1;LEN(CELL("filename";$A$1))-FIND("]";CELL("filename";$A$1);1))) in A1, and then the values.
Can somebody help me with this macro ?
I have nothing until now. Actually I have some code parts that I can't combine.
If it is possible I would like also that the macro contain a line to open SecondWB if it isn't opened, and after copying the values to save it and close it.
Thank you in advance