Automating a mailing procedure

chris1986

New Member
Joined
Apr 23, 2009
Messages
10
Hi,

I work for a printing company and we recieve a weekly .csv database that provides us the data to print and fulfil a mailing campaign. The number of records vary each week (2500 to 6000 +).

We have to validate certain fields of data and "suppress" the fields that don't meet the criteria. We then need to sort the data on several columns in turn, to select the 5 x longest and shortest records in specific cells to provide proofs with.

We then need to add a common reference to a cell on each row & also sequentially number so we can track each individual record through production.

We currently have a template that we copy and paste the .csv data into, it has conditional formatting and preset formulas to speed up the process, however there is still manual intervention that I think could be eliminated by using a macro..... The only problem is, I don't know how to write it!

So I am cap in hand asking for someone to help me with a macro that will do the following:

I would like to be able to press a button within the worksheet that will execute the macro, the 1st stage will open a browsing box so the user can select the .csv file to import.
Once this is selected, there will be a prompt asking the user to enter a "DM Number", this will be the common reference added to each row of data.

The .csv file’s columns are formatted in the following way:
A – M_MDBKey
B - M_SRec_ID
C – Agree no
D – Title
E – Forenames
F – Initials
G – LastNm
H - QAS_Add_Ln_1
I - QAS_Add_Ln_2
J - QAS_Town
K - QAS_Area
L - QAS_Pcode
M - Street_Nm

I would like the original, unprocessed data to be inserted into a worksheet in the workbook named “Original” to retain the initial data.

A copy of this data will also be inserted into a “working data” worksheet.
I would then like to validate the data in “working data” to create a “suppression” list, the criteria to suppress records is as follows:
· If the Title cell is blank
· If the length of the QAS_Pcode & Street_Nm – 3 (e.g =LEN(L2&M2)-3 ) is more than 27

If the rows fail the criteria, they are removed from the “working data” worksheet, and inserted into a “suppression” worksheet.

The “working data” sheet now contains the relevant data, I would then like the “DM Number” that the user was prompted for initially to be inserted onto each row in a subsequent column (N), and a sequential number (starting from 1) to be added to the next column (O).

I would then need to copy the 5 x longest & shortest records from the following columns:
· G – LastNm
· L - QAS_Pcode
· H - QAS_Add_Ln_1
· QAS_Pcode & Street_Nm – 3 (e.g =LEN(L2&M2)-3 )

In addition to this anything with “SEED” in the: A – M_MDBKey, B - M_SRec_ID, C – Agree no fields.

These rows need to be copied and inserted into another worksheet named “proofs”

I understand that I am asking for a lot here but I would be very grateful if someone could help!

Many thanks,

Chris
 

Excel Facts

What is =ROMAN(40) in Excel?
The Roman numeral for 40 is XL. Bill "MrExcel" Jelen's 40th book was called MrExcel XL.
Sorry to bump this thread - does anyone have any ideas that could help automate this procedure, or point me in the right direction?

Many thanks in advance.
 
Upvote 0

Forum statistics

Threads
1,223,238
Messages
6,170,939
Members
452,368
Latest member
jayp2104

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top