+ Reply to Thread
Results 1 to 6 of 6

How to adapt a code to include a range of cells instead of the whole sheet

  1. #1
    Valued Forum Contributor
    Join Date
    06-23-2010
    Location
    North West
    MS-Off Ver
    office 2010
    Posts
    355

    How to adapt a code to include a range of cells instead of the whole sheet

    First of all thank you to the person who provided the code that I have been trying to adapt, I got it from another post on this forum.
    The code I have in module 5 works to a great degree but it sends too much in the attachment.
    I want to be able to click a button and send the letter only, cells J1 to R51 (not the whole sheet) it converts it to a PDF and then attaches to an email in outlook brilliantly.

    I have attached a workbook for reference. The workbook will eventually have 11 sheets, so I thought I could put a button on each sheet for each letter.
    Cells U6 and U7 are where the email address and subject title go
    I forgot to mention that the letter sheet will be protected
    Many thanks
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    07-15-2012
    Location
    Leghorn, Italy
    MS-Off Ver
    Excel 2010
    Posts
    3,431

    Re: How to adapt a code to include a range of cells instead of the whole sheet

    Please Login or Register  to view this content.
    If solved remember to mark Thread as solved

  3. #3
    Valued Forum Contributor
    Join Date
    06-23-2010
    Location
    North West
    MS-Off Ver
    office 2010
    Posts
    355

    Re: How to adapt a code to include a range of cells instead of the whole sheet

    Hello patel45, thanks for taking the time to look.
    I have inserted your code where it said MyFilePath = ThisWorkbook.Path , I'm not sure if that is where it is supposed to go or not.
    Unfortunately, it still emails the wrong of the sheet and doesn't include J1 to R51 at all.
    Could you tell me exactly where to insert your new bit of code please
    Thanks

  4. #4
    Valued Forum Contributor
    Join Date
    06-23-2010
    Location
    North West
    MS-Off Ver
    office 2010
    Posts
    355

    Re: How to adapt a code to include a range of cells instead of the whole sheet

    Patel45
    I've re attached my example so you can see where I've inserted your extra bit of code in module 5
    Attached Files Attached Files

  5. #5
    Forum Expert
    Join Date
    07-15-2012
    Location
    Leghorn, Italy
    MS-Off Ver
    Excel 2010
    Posts
    3,431

    Re: How to adapt a code to include a range of cells instead of the whole sheet

    you added my code instead of replacing, you have to eliminate
    Please Login or Register  to view this content.

  6. #6
    Valued Forum Contributor
    Join Date
    06-23-2010
    Location
    North West
    MS-Off Ver
    office 2010
    Posts
    355

    Re: How to adapt a code to include a range of cells instead of the whole sheet

    patel45,
    Thank you very much for your help, I now realise what you wanted me to do and it works.
    Thanks again

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] Adapt VBA code to clear the related cells instead of update
    By michelle 1 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 07-26-2013, 05:50 AM
  2. [SOLVED] How to adapt winnons macro for clearing cells to work when sheet is protected
    By nje in forum Excel Programming / VBA / Macros
    Replies: 24
    Last Post: 02-06-2013, 01:03 PM
  3. Adapt code to include "number" and colour formatting
    By dpcp in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 08-22-2011, 07:12 AM
  4. Change code so that Dynamic ranges include sheet name
    By dcgrove in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 06-02-2011, 03:51 PM
  5. Replies: 2
    Last Post: 08-05-2005, 01:05 AM

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