Results 1 to 15 of 15
  1. #1
    2 Star Lounger
    Join Date
    Jun 2005
    Location
    Atlanta, Georgia, USA
    Posts
    208
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Word document and zip codes (2003)

    Hello,

    I have a word document that I need to put a range of 5 digit zip codes in certain boxes. For example, zips from 70000 to 70200. The problem is that I don't want to type every zip code seperated by a space in there because there are probably over 1000 zips. I thought of using excel and doing a series of zips across, then paste into a notepad then copy into word. Is there an easier way to automate this process?

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Word document and zip codes (2003)

    You could write a macro that prompts for the start number and end number, then enters the zip codes into the document.
    If you want help with that, we'd need to know something about the document - where exactly should the zip codes end up?

  3. #3
    2 Star Lounger
    Join Date
    Jun 2005
    Location
    Atlanta, Georgia, USA
    Posts
    208
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Word document and zip codes (2003)

    I have the hard copy and not the electronic form. It is a template that has a box and to the right it has the person who is responsible for the zips in that certain state. Do you need the form?

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Word document and zip codes (2003)

    Do you need to fill in one box, or multiple boxes?

  5. #5
    2 Star Lounger
    Join Date
    Jun 2005
    Location
    Atlanta, Georgia, USA
    Posts
    208
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Word document and zip codes (2003)

    It would be multiple boxes. Each nurse has a zip range for each state and there are about 8 states.

  6. #6
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Word document and zip codes (2003)

    Then we'd need to see the document, I think.

  7. #7
    Super Moderator
    Join Date
    Jan 2001
    Location
    Melbourne, Victoria, Australia
    Posts
    3,852
    Thanks
    4
    Thanked 259 Times in 239 Posts

    Re: Word document and zip codes (2003)

    Try a macro like this...
    <pre>Sub temp1()
    Dim iStart As Long, iEnd As Long, sSeries As String
    Dim x As Long
    iStart = InputBox("Starting Number?", "Number", 70000)
    iEnd = InputBox("Ending Number?", "Number", 70420)
    For x = iStart To iEnd
    sSeries = sSeries & x & " "
    Next x
    Selection.TypeText sSeries
    End Sub</pre>

    Andrew Lockton, Chrysalis Design, Melbourne Australia

  8. #8
    Lounger
    Join Date
    Jul 2003
    Posts
    41
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Word document and zip codes (2003)

    I like this code and think it will be useful down the road. I have been unsuccessful in trying to change the space between the numbers to a tab or maybe a carriage return. Is this possible?

  9. #9
    Super Moderator
    Join Date
    Jan 2001
    Location
    Melbourne, Victoria, Australia
    Posts
    3,852
    Thanks
    4
    Thanked 259 Times in 239 Posts

    Re: Word document and zip codes (2003)

    To change the space into a tab change the following line
    sSeries = sSeries & x & " "
    to
    sSeries = sSeries & x & vbTab
    or for a return in between then numbers
    sSeries = sSeries & x & vbCr
    Andrew Lockton, Chrysalis Design, Melbourne Australia

  10. #10
    Lounger
    Join Date
    Jul 2003
    Posts
    41
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Word document and zip codes (2003)

    Thank you Andrew. It works. I tried vbTab and vbCr last Friday, but I was leaving the quotation marks around them.
    Unfortunately, this does not do what I wanted after all. I was hoping to get the number to tab to the next cell in a table. Is that easy to do?

    Carol

  11. #11
    Super Moderator
    Join Date
    Jan 2001
    Location
    Melbourne, Victoria, Australia
    Posts
    3,852
    Thanks
    4
    Thanked 259 Times in 239 Posts

    Re: Word document and zip codes (2003)

    Yes, its easy to do but you haven't provided a sample file so we can see what you really want to do - this has a significant bearing on how the code is written. Try selecting the text after this code runs and then choosing Table>Create Table from Text using either a space, tab or return as the cell delimiter.
    Andrew Lockton, Chrysalis Design, Melbourne Australia

  12. #12
    Lounger
    Join Date
    Jul 2003
    Posts
    41
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Word document and zip codes (2003)

    Okay - that may be useful. Looking closer, I think maybe it just will not work here for this example. Every new year my year at-a-glance calendar is updated with the month starting on a new day (of course). Currently, to do this I select a month's worth of cells starting with a Sunday and use format - bullets and numbering. Then I delete the numbers under say Sunday if the month starts on a Monday and delete the numbers at the end of the month not needed. Then I convert the number to text and do a little more formatting. I have attached an example document for reference, but again I think I'm stuck doing it this round about way. Thank you for your time.
    Carol
    Attached Files Attached Files

  13. #13
    Plutonium Lounger
    Join Date
    Nov 2001
    Posts
    10,550
    Thanks
    0
    Thanked 7 Times in 7 Posts

    Re: Word document and zip codes (2003)

    Not an answer to your question, but this Excel calendar may do what you need

    Modify cell B2 on the Month or Year sheet to update the dates on the whole sheet
    Mofify the data on the Birthdays sheet to add special dates

    StuartR
    Attached Files Attached Files

  14. #14
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Word document and zip codes (2003)

    Microsoft also has many freely downloadable calendar templates, for Word, Excel, PowerPoint and Publisher, varying from 1 week per page to multiple years per page. See Calendars - Templates - Microsoft Office Online.

  15. #15
    Lounger
    Join Date
    Jul 2003
    Posts
    41
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Word document and zip codes (2003)

    Thank you StuartR for the Excel file and thank you Hans for the link to Microsoft templates.
    I checked out the calendar templates before but I guess I overlooked the multi-month calendars.
    I will check this out come next December!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •