+ Reply to Thread
Results 1 to 12 of 12

Macro to save text of active cells to notebook

  1. #1
    Forum Contributor
    Join Date
    06-25-2012
    Location
    Porto, Portugal
    MS-Off Ver
    Excel 2010
    Posts
    201

    Macro to save text of active cells to notebook

    Hi. I need a macro to get the content of a collumn of cells. The thing is that i need it to get only the data from the cells who have data shown on them, because i have a formula in those cells as, for example, IF(A1="";"";A1). So if A1 is "" then it will show nothing but if is [email protected], for example, it will show this mail. So in a collum i have this kind (more complex) of formulas (C1:C100) and i need a macro to get the content of the cells in this range who shows values only. But the macro as to get these mails and paste them as: "[email protected]; [email protected]; ....and so on" in a new notebook file which as to be stored with the name of the file MAIL in the same folder of the workbook.

    I added a example file which shows exactly what i need and a image so you can understand what i really mean.
    Thank you very much and hope someone can help.
    Attached Images Attached Images
    Attached Files Attached Files

  2. #2
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: Macro to save text of active cells to notebook

    Hello Taislin,

    Add a VBA module to your workbook and add the code below to it.
    Please Login or Register  to view this content.
    Sincerely,
    Leith Ross

    Remember To Do the Following....

    1. Use code tags. Place [CODE] before the first line of code and [/CODE] after the last line of code.
    2. Thank those who have helped you by clicking the Star below the post.
    3. Please mark your post [SOLVED] if it has been answered satisfactorily.


    Old Scottish Proverb...
    Luathaid gu deanamh maille! (Rushing causes delays!)

  3. #3
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: Macro to save text of active cells to notebook

    Hello Taislin,

    Add a VBA module to your workbook and add the code below to it.
    Please Login or Register  to view this content.

  4. #4
    Forum Contributor
    Join Date
    06-25-2012
    Location
    Porto, Portugal
    MS-Off Ver
    Excel 2010
    Posts
    201

    Re: Macro to save text of active cells to notebook

    @Leith Ross

    Hi. Thank you for your quick response. I tried this code in my sample workbook (the one ip added in the first post) and it does nothing. I think the code is not directed for my sample workbook i provided. Perhaps you could download the file and see what i really need and put the code for the example i made so i can understand better the code with my sample please. If you dont want to download the xls file there is also an image of a printscreen that explains really well the excel sample file and what i need the macro to do in that sample. So if you could help i would be really gratefull.
    Thank you
    Regards:
    Mário Machado

  5. #5
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: Macro to save text of active cells to notebook

    Hello Taislin,

    I have installed the macro in the attached workbook. There is a button on the page to run the macro. The emails will save to a text file named EMAIL.txt in the same directory as the workbook.
    Attached Files Attached Files

  6. #6
    Forum Contributor
    Join Date
    06-25-2012
    Location
    Porto, Portugal
    MS-Off Ver
    Excel 2010
    Posts
    201

    Re: Macro to save text of active cells to notebook

    Thank you very much. Perect.

  7. #7
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: Macro to save text of active cells to notebook

    Hello Taislin,

    You're welcome. Glad we got it working.

  8. #8
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: Macro to save text of active cells to notebook

    Hello Taislin,

    You're welcome. Glad we got it 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