+ Reply to Thread
Results 1 to 6 of 6

Add text to cells with existing content - with a challenging twist!

  1. #1
    Registered User
    Join Date
    09-27-2011
    Location
    Stockholm, Sweden
    MS-Off Ver
    Excel 2010
    Posts
    7

    Add text to cells with existing content - with a challenging twist!

    This is solved, check new problem down!

    Hi all!

    After intense googling I didn't find the solution to my problem which is why I'm asking for your help!

    I've got a macro which is running in a regular excel-file exported from one system. It is moving around columns and adding headlines to fit as an import into another system.
    In one column, AF, I want to add the string "Att: " before the already existing content.
    Since the number of rows differs from document to document I want it to add "Att: " (WITH content, if it's empty it shouldn't do anything) as long as column A has rows.

    I've got a similar code from another column;
    Please Login or Register  to view this content.
    But this is replacing existing content and fills ALL cells in column C to "Y" on as many rows that there is in column A .

    In my new case every column is unique and the existing content should remain with the adding of "Att: ".
    I've tried:
    Please Login or Register  to view this content.
    But this only works for the first cell in the column ("AF2") and replaces that content into every other.

    Please use the same column-names, string-names etc. in your solution. All headlines
    are on row 1, the data starts att row 2 and should end when column A rows end.

    Does this make sense?

    Thanks in advance!


    This is solved, check new problem down!
    Last edited by madjan; 09-29-2011 at 09:30 AM. Reason: Solved again!

  2. #2
    Forum Expert tigeravatar's Avatar
    Join Date
    03-25-2011
    Location
    Colorado, USA
    MS-Off Ver
    Excel 2003 - 2013
    Posts
    5,361

    Re: Add text to cells with existing content - with a challening twist!

    madjan,

    Give this a try:
    Please Login or Register  to view this content.


    Hope that helps,
    ~tigeravatar

  3. #3
    Registered User
    Join Date
    09-27-2011
    Location
    Stockholm, Sweden
    MS-Off Ver
    Excel 2010
    Posts
    7

    Re: Add text to cells with existing content - with a challening twist!

    Quote Originally Posted by tigeravatar View Post
    madjan,

    Give this a try:
    Please Login or Register  to view this content.


    Hope that helps,
    ~tigeravatar
    Thanks alot, mate! Amazingly done. Saved my day!

    Got time to explain your code row by row? I don't understand it to 100%!

    Thanks once again.

  4. #4
    Registered User
    Join Date
    09-27-2011
    Location
    Stockholm, Sweden
    MS-Off Ver
    Excel 2010
    Posts
    7

    Re: Add text to cells with existing content - with a challenging twist!

    I've got a new question, a spin off from the last solution.

    I got a new column (M), this should add c/o: instead of Att: AND add a "-" to all empty cells. Everything else should be the same, i.e. stopp when rows in column A stops.

    Please Login or Register  to view this content.
    Anyone?

    Thanks in advance.

  5. #5
    Forum Expert tigeravatar's Avatar
    Join Date
    03-25-2011
    Location
    Colorado, USA
    MS-Off Ver
    Excel 2003 - 2013
    Posts
    5,361

    Re: Add text to cells with existing content - with a challenging twist!

    madjan,

    Something like this?
    Please Login or Register  to view this content.


    Hope that helps,
    ~tigeravatar

  6. #6
    Registered User
    Join Date
    09-27-2011
    Location
    Stockholm, Sweden
    MS-Off Ver
    Excel 2010
    Posts
    7

    Re: Add text to cells with existing content - with a challenging twist!

    Quote Originally Posted by tigeravatar View Post
    madjan,

    Something like this?
    Please Login or Register  to view this content.


    Hope that helps,
    ~tigeravatar
    Thank you again, amazingly much!

+ 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