+ Reply to Thread
Results 1 to 4 of 4

VBA code affecting header unintentionally

  1. #1
    Registered User
    Join Date
    07-14-2011
    Location
    Cocoa Beach, Florida
    MS-Off Ver
    Excel 2007
    Posts
    79

    VBA code affecting header unintentionally

    So, I figured out how to add a defined text string to the end of the values in my cells, but now I have run into another issue.

    I took a piece of code that I found from someone else with another question and I modified it (as best I could with my limited experience) to fit what I needed.

    Long story short:

    I am copying info from one excel workbook to a new workbook, each column has been changed so that they are in different orders. In column "E" in my new workbook I am adding the file extension ".pdf" to the end of the values that were copied over. The code I have thus far looks like :


    Please Login or Register  to view this content.

    but the issue I have is that it is modifying my header "E1" to say "Document File Name.pdf" instead of leaving it as "Document File Name". I thought I would just get around my limited experience by having the macro alter the entire column, then tell it to change the value in E1 with

    Please Login or Register  to view this content.
    right after the addition of the ".pdf" takes place. For some reason my coding runs through fine, no errors occur but I still end up with ".pdf" at the end of my header title, how can I get rid of this?


    Sorry for all the questions but my work through me on this and I have no clue as to how to do it, neither do they but they want me to figure it out lol.
    Last edited by sk8shorty01; 07-18-2011 at 12:39 PM.

  2. #2
    Valued Forum Contributor realniceguy5000's Avatar
    Join Date
    03-20-2008
    Location
    Fl
    MS-Off Ver
    Excel 2003 & 2010
    Posts
    951

    Re: VBA code affecting header unintentionally

    Maybe?

    Please Login or Register  to view this content.
    Thank You, Mike

    Some Helpful Hints:

    1. New members please read & follow the Forum Rules
    2. Use Code Tags...Place[code]Before the first line and[/code] After the last line.
    3. If you are pleased with a solution mark your post SOLVED.
    4. Thank those who have help you by clicking the scales at the top right of the post.

    Here...

  3. #3
    Valued Forum Contributor MaczaQ's Avatar
    Join Date
    06-03-2011
    Location
    Poland
    MS-Off Ver
    Excel 2003 / XP
    Posts
    510

    Re: VBA code affecting header unintentionally

    Hello,

    Maybe this code will help you ?
    Please Login or Register  to view this content.
    Best Regards

  4. #4
    Registered User
    Join Date
    07-14-2011
    Location
    Cocoa Beach, Florida
    MS-Off Ver
    Excel 2007
    Posts
    79

    Re: VBA code affecting header unintentionally

    Thank you guys very much for the help, it is now working!

+ 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