echane
11-09-2009, 12:31 PM
Hi!
I'm a complete newbie with VBA so I can't quite figure out how to do the following. I'm sure it's probably very easy for some of you out there. I've attached an excel of an example of what I want to do.
I want a macro that will copy information from one worksheet to a new one based on one of two possible templates. In the file, I have a "Data" tab and two template tabs that are different. I have silly information in the data tab like different fruits and vegetables right now. I want to be able to run a macro that will go down the list of different fruits and vegetables and create a new worksheet for each one from a template. I don't want a new worksheet for every single one though, only the ones where in the data tab, the column labeled "Report" says "Yes". I have a column in there that labels each entry as either a fruit or vegetable. I want the macro to know that if it's labeled "fruit" it'll copy the "fruit template" and likewise for vegetables. I would also like the new worksheets to be named what it is in Column A of the "Data" tab.
In addition, I want each new worksheet to be prepopulated with certain information like the Product name, ID, and these other "Category x" fields. Ideally, the point is after each worksheet is generated, I can fill in more specific information for each product in the boxes labeled "Field" on the template.
I have one last tab in there called "Apples" that shows what I want a new worksheet to look like.
Sorry if I'm not good at explaining. The attached file should make it clearer. Thanks in advance!
I'm a complete newbie with VBA so I can't quite figure out how to do the following. I'm sure it's probably very easy for some of you out there. I've attached an excel of an example of what I want to do.
I want a macro that will copy information from one worksheet to a new one based on one of two possible templates. In the file, I have a "Data" tab and two template tabs that are different. I have silly information in the data tab like different fruits and vegetables right now. I want to be able to run a macro that will go down the list of different fruits and vegetables and create a new worksheet for each one from a template. I don't want a new worksheet for every single one though, only the ones where in the data tab, the column labeled "Report" says "Yes". I have a column in there that labels each entry as either a fruit or vegetable. I want the macro to know that if it's labeled "fruit" it'll copy the "fruit template" and likewise for vegetables. I would also like the new worksheets to be named what it is in Column A of the "Data" tab.
In addition, I want each new worksheet to be prepopulated with certain information like the Product name, ID, and these other "Category x" fields. Ideally, the point is after each worksheet is generated, I can fill in more specific information for each product in the boxes labeled "Field" on the template.
I have one last tab in there called "Apples" that shows what I want a new worksheet to look like.
Sorry if I'm not good at explaining. The attached file should make it clearer. Thanks in advance!