+ Reply to Thread
Results 1 to 3 of 3

Copy cell value, add additonal text and write to Text file

  1. #1
    Registered User
    Join Date
    12-11-2010
    Location
    Texas
    MS-Off Ver
    Excel 2007
    Posts
    16

    Copy cell value, add additonal text and write to Text file

    Hi everyone, I was looking for some help with something. I've searched around on Google and I can't find a solution to what I am looking to do. I was hoping someone would be able to help me?

    I've attached an Excel file with what I am working on. What I am looking to do, is to look at a value in column F, add some additional information to it and repeat the previous steps if the quantity is greater than 1.

    Example:
    Take value from F3 and format it to look like this:

    A,1,2' 1 11/16",C

    The A, C and commas placement will always be a constant. The second value (number 1) will have to increase as the number of rows are added. Also, I would like to be able to repeat any lengths if their quantity is greater than 1.

    If you look at cell B32:B47, this is the type of list I would like to create but as you can see, I'm not sure how to amend the formula to account for quantities greater than 1.

    If possible, would it be possible to export the list to a Txt file with a macro or VBA?

    Thank you in advance for any and all help!
    Attached Files Attached Files

  2. #2
    Registered User
    Join Date
    12-11-2010
    Location
    Texas
    MS-Off Ver
    Excel 2007
    Posts
    16

    Re: Copy cell value, add additonal text and write to Text file

    I kind of figured out how to create a macro to export the list to a TXT file with this code:
    Please Login or Register  to view this content.
    The only downside is that it puts quotes on either side of my pasted values and right after my quote for the inches.

    Ex: "A,1,2' 1 11/16"",C" but it should look like A,1,2' 1 11/16",C

    Is there a way to fix this? Or a better solution?

    TIA

  3. #3
    Registered User
    Join Date
    12-11-2010
    Location
    Texas
    MS-Off Ver
    Excel 2007
    Posts
    16

    Re: Copy cell value, add additonal text and write to Text file

    Did some more searching and came up with some new code that copied and expanded my list based on quantity.

    Code:
    Please Login or Register  to view this content.
    I found it at that this website through a Google search: http://www.eggheadcafe.com/software/...-variable.aspx

    Of course I had to modify it for my particular instance. That was a learning curve to decipher some of the code...even though I don't know what 90% of it means...lol

    In the new attached Excel file, is there a way to combine the two macros from module 3 & 4? Or possibly run them from one button?

    Thanks again!
    Attached Files Attached Files

+ 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