+ Reply to Thread
Results 1 to 7 of 7

code to assign value from a file to variable

  1. #1
    Registered User
    Join Date
    10-22-2009
    Location
    bangalore
    MS-Off Ver
    Excel 2007
    Posts
    4

    code to assign value from a file to variable

    Hi There,

    Can someone help me to resolve my problem; I have a file which contain below informations

    First Name: ABC
    Last Name: CDE
    Date of Birth: 12/12/1212

    I want to create a text file as below

    This is to confirm <First name> < Last Name>, etc etc

    so in this letter, ABC should replace first name with ABC, Last Name with CDE etc
    Pls help

  2. #2
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,436

    Re: code to assign value from a file to variable

    Is this for a single piece of information or do you have many First/Last names and dates? If so would you not use Word and Mail Merge.
    Cheers
    Andy
    www.andypope.info

  3. #3
    Registered User
    Join Date
    10-22-2009
    Location
    bangalore
    MS-Off Ver
    Excel 2007
    Posts
    4

    Cool Re: code to assign value from a file to variable

    Hi Andy,

    Thanks for your response...there are many piece of information, around 20 parameters like first name, last name.. I'm trying to use mail merge for this

  4. #4
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,436

    Re: code to assign value from a file to variable

    Hopefully your data tables is set up with headers in row 1 like so

    First | Last | Date | etc

    and each following row is a unique record/letter to be mail merged.

    What problem are you having exactly?

  5. #5
    Registered User
    Join Date
    10-22-2009
    Location
    bangalore
    MS-Off Ver
    Excel 2007
    Posts
    4

    Re: code to assign value from a file to variable

    first name, last name,etc are not unique,, it always changes.. I need to prepare letter for customers with there first name, last name etc etc

  6. #6
    Registered User
    Join Date
    10-22-2009
    Location
    bangalore
    MS-Off Ver
    Excel 2007
    Posts
    4

    Re: code to assign value from a file to variable

    I get information like below,

    ex1)
    First Name : ABC
    Last Name: CDE

    So letter, should look like - This is to confirm ABC CDE, etc etc

    ex2)

    First Name: XYZ
    Last Name: YZ

    So letter should look like, This is confirm XYZ YZ, etc etc

    So, lett

  7. #7
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,436

    Re: code to assign value from a file to variable

    Well that's your problem then.
    You need to change the layout of your data.

    Duplicate first/last names are not a problem as each row is a unique record.

    Have read up on mail merge
    http://word.mvps.org/FAQs/MailMerge/index.htm

+ 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