RobMolyneux
New Member
- Joined
- Sep 14, 2016
- Messages
- 18
Hi, I hope that someone can help as I'm really struggling and tripping myself up.
I receive data on a monthly basis which is always in the same format (number of columns) but can vary in data sets from 4,000 to 10,000 rows, and the data within is pretty variable.
I've written 4 basic macros which help to add labels to the data to allow me to filter it easily, but i now want to write another which will automatically process the data based on certain criteria being met.
I have 2 sheets in my current workbook
1) "Data" which is where i plan to copy and paste the data i receive in columns A-V
2) "Run" which is where i have created buttons with 4 macros embedded as a workflow that i can follow in order
the current 4 macros do the following:
1) add a new column W, with the heading "Category", and puts either "New", "Existing" or "Conversion" into column W for each row, based on what is contained in the data in column B
2) Add a new column X, with heading "Sub-Category", and puts either "House", "Bungalow", "Flat" or "Combo/Other" into column W, based on what is contained in the data in column B
3) add a new column Y, with heading "With Basement", and puts either "Yes" or "No" into column Y, based on what is contained in the data in column L
4) add a new column Z, with heading "Contact", and puts either "Yes" or "No" into column Y, based on what is contained in the data in column V
Within the "Run" sheet, I have added drop down boxes for selection by the user, which then combine as text in cell G33, which i would like to use as a automatic file name when i create the new workbook.
From here, I would like to write a macro to do the following;
When clicked, create a new workbook, automatically named as per the value in cell G33, with 3 worksheets (named "Leeds", "ContactABC" & "ExistingABC")
I then want those 3 worksheets to copy and past all rows and columns from the "Data" sheet based on the following criteria;
I want to copy data into "Leeds" if it meets the following criteria:
Column W = ("New" or "Conversion" ) AND column Z = "Yes"
OR
Column W = "Existing" AND Column Y = "Yes" AND Column Z = "Yes"
I want it to copy data into the "ContactABC" sheet based on the same criteria as above but Column Z = "No"
I then want to copy everything else into the "ExistingABC" sheet.
can this be done, and if so, what coding do i need.
many, many thanks in advance.
I receive data on a monthly basis which is always in the same format (number of columns) but can vary in data sets from 4,000 to 10,000 rows, and the data within is pretty variable.
I've written 4 basic macros which help to add labels to the data to allow me to filter it easily, but i now want to write another which will automatically process the data based on certain criteria being met.
I have 2 sheets in my current workbook
1) "Data" which is where i plan to copy and paste the data i receive in columns A-V
2) "Run" which is where i have created buttons with 4 macros embedded as a workflow that i can follow in order
the current 4 macros do the following:
1) add a new column W, with the heading "Category", and puts either "New", "Existing" or "Conversion" into column W for each row, based on what is contained in the data in column B
2) Add a new column X, with heading "Sub-Category", and puts either "House", "Bungalow", "Flat" or "Combo/Other" into column W, based on what is contained in the data in column B
3) add a new column Y, with heading "With Basement", and puts either "Yes" or "No" into column Y, based on what is contained in the data in column L
4) add a new column Z, with heading "Contact", and puts either "Yes" or "No" into column Y, based on what is contained in the data in column V
Within the "Run" sheet, I have added drop down boxes for selection by the user, which then combine as text in cell G33, which i would like to use as a automatic file name when i create the new workbook.
From here, I would like to write a macro to do the following;
When clicked, create a new workbook, automatically named as per the value in cell G33, with 3 worksheets (named "Leeds", "ContactABC" & "ExistingABC")
I then want those 3 worksheets to copy and past all rows and columns from the "Data" sheet based on the following criteria;
I want to copy data into "Leeds" if it meets the following criteria:
Column W = ("New" or "Conversion" ) AND column Z = "Yes"
OR
Column W = "Existing" AND Column Y = "Yes" AND Column Z = "Yes"
I want it to copy data into the "ContactABC" sheet based on the same criteria as above but Column Z = "No"
I then want to copy everything else into the "ExistingABC" sheet.
can this be done, and if so, what coding do i need.
many, many thanks in advance.