Auto insert row, zip code, multiple find and replace


Posted by Vic on August 30, 2000 3:06 PM

I'm a beginner to Excel (my biggest accomplishments are using the IF and CONCATENATE formulas).

I have three questions. First, some background. I work with mailing lists all day long. I use Office 2000. With that;

1) How do I automatically insert rows on a work sheet? For example, we use mail merge a lot to print Avery labels with data imported from Excel. We usually send batches of tasks to the printer. I would like to be able to insert rows automatically in a worksheet that has, say 40,000 records, after every 1000 records. This way, we will know when one batch starts and the other begins (that is 40,000 is equally divisible by 1000, i.e. 40 batches of labels).

Right know, I have to do this manually, inserting a blank row (or the words BREAK) every 1000 records.

2) We import data from various sources quite frequently. One problem I have is in the zip code field. Some data has the standard five digit zip, some have the zip plus four. It gets all mixed up when I use FORMAT-CELLS-SPECIAL and select ZIP or ZIP + 4. How do I uniformize this to get ONLY five digits even if the data has nine digits (no dashes, just straight numbers).

3) Is there a way to do multiple FIND and REPLACE instead of typing it in one at a time? For example, if I highlight a column and want to search for all the A's and B's and C's (and all the single letters of the alphabet), how do I this without having to do a FIND and REPLACE 26 times?

Thank you so very much!! This will help me an enormous amount!

~ Vic

Posted by Celia on August 31, 0100 12:53 AM

Re: Zip-Codes


Vic
Is it the first 5 numbers of the zip-code that you need? If so, I think the following will do it :-
=LEFT(A1,5)
Celia



Posted by Celia on August 30, 0100 11:38 PM

Re: Auto insert row


Vic
Re inserting rows :-

Sub InsertRows()
Dim startRow As Range
Set startRow = Rows("1001:1001")
Application.ScreenUpdating = False
Do Until Application.CountA(startRow) = 0
startRow.Insert Shift:=xlDown
Set startRow = startRow.Offset(1000, 0)
Loop
End Sub

Celia