+ Reply to Thread
Results 1 to 5 of 5

Excel Macro help needed!

  1. #1
    Registered User
    Join Date
    11-12-2006
    Posts
    1

    Excel Macro help needed!

    Hi,

    I am hoping for an automated way to perform the following task. We need to do this task every day and at the moment it is a manual process envolving removing blanks spaces from a list of emails and several 'concatenate' and 'left' fuctions. The end results takes about half an hour and it is a perfect for a macro.

    The problem is as follows:
    I have a list of email addresses of varying character lengths. This list need to be processed into a txt document with a specific 60 character layout as below. The list in entered manually by end users and sometimes has spaces either beginning, withion or ending the email address. These blank spaces need to be removed before the layout below is processed.


    Characters 1 > 50:
    Starts with the email address. If the email address is shorter than 50 characters then the remaining characters are blank.

    Characters 50 > 58:
    Todays date in the format YYYYMMDD (eg: 20060727)

    Characters 59 and 60:
    Two blank characters end the sequence.


    I have put an example of the final file on my personal webiste at http://www.digbyhead.com/sample.txt

    This will save us hours a week if we could automate this process so any help is appreciated.

    Best regards,
    Charles Head
    charles_head@hotmail.com

  2. #2
    Registered User
    Join Date
    08-17-2004
    Posts
    10
    Haven't been able to look at your file (Internet filters...) but, if you had the email address in cell A1, this will put it in the format you want and put the result in B1:

    Please Login or Register  to view this content.
    -----------
    Em

    There are 10 types of people in this world. Those that can read binary and those that can't.

  3. #3
    Forum Contributor
    Join Date
    03-13-2005
    Posts
    6,195
    Quote Originally Posted by charles_head
    Hi,

    I am hoping for an automated way to perform the following task. We need to do this task every day and at the moment it is a manual process envolving removing blanks spaces from a list of emails and several 'concatenate' and 'left' fuctions. The end results takes about half an hour and it is a perfect for a macro.

    The problem is as follows:
    I have a list of email addresses of varying character lengths. This list need to be processed into a txt document with a specific 60 character layout as below. The list in entered manually by end users and sometimes has spaces either beginning, withion or ending the email address. These blank spaces need to be removed before the layout below is processed.


    Characters 1 > 50:
    Starts with the email address. If the email address is shorter than 50 characters then the remaining characters are blank.

    Characters 50 > 58:
    Todays date in the format YYYYMMDD (eg: 20060727)

    Characters 59 and 60:
    Two blank characters end the sequence.


    I have put an example of the final file on my personal webiste at http://www.digbyhead.com/sample.txt

    This will save us hours a week if we could automate this process so any help is appreciated.

    Best regards,
    Charles Head
    charles_head@hotmail.com
    Easiest is probably to setup a Macro, set a Letter to trigger the macro, and replace the macro code with
    Please Login or Register  to view this content.
    This should split your data much the same way that selecting column A, then Data, Text to Columns, Fixed Width, set the widths, Finish, would achieve.

    hth
    ---

    note, there are three types of people in the world, those who can count, and those who can't.
    Last edited by Bryan Hessey; 11-12-2006 at 11:14 PM.
    Si fractum non sit, noli id reficere.

  4. #4
    Forum Expert
    Join Date
    11-23-2005
    Location
    Rome
    MS-Off Ver
    Ms Office 2016
    Posts
    1,628
    You can try to use this code that will create the output file from your worksheet data_

    Please Login or Register  to view this content.
    I hope it's what you need.

    Regards,
    Antonio

  5. #5
    Forum Contributor
    Join Date
    03-13-2005
    Posts
    6,195
    Quote Originally Posted by antoka05
    You can try to use this code that will create the output file from your worksheet data_

    Please Login or Register  to view this content.
    I hope it's what you need.

    Regards,
    Antonio
    Good point antoka05, it's going out not coming in, but does it need the two spaces for char 59-60 to make the length?

    ---

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1