+ Reply to Thread
Results 1 to 5 of 5

Using Ron de Bruin RangetoHTML on multiple macros

  1. #1
    Forum Contributor
    Join Date
    10-02-2013
    Location
    Houston, TX
    MS-Off Ver
    office 365
    Posts
    638

    Using Ron de Bruin RangetoHTML on multiple macros

    I have multiple macros that are in their own modules and I have the "RangetoHTML" at the bottom of all of them so they run perfectly.

    My questions is I am trying to clean up the code and wondered can you have that code by Ron de Bruin RangetoHTM in a separate location and if any macro that is generating an email can go and utilize the code from there and not need to add to every macro separately.

    Thanks

  2. #2
    Forum Expert CK76's Avatar
    Join Date
    06-16-2015
    Location
    ONT, Canada
    MS-Off Ver
    MS365 Apps for enterprise
    Posts
    5,897

    Re: Using Ron de Bruin RangetoHTML on multiple macros

    You can store the subroutine in separate module and run it in other subroutines.

    Ex: Store RangetoHTML in Module2. And others in Module1.
    ?Progress isn't made by early risers. It's made by lazy men trying to find easier ways to do something.?
    ― Robert A. Heinlein

  3. #3
    Forum Contributor
    Join Date
    10-02-2013
    Location
    Houston, TX
    MS-Off Ver
    office 365
    Posts
    638

    Re: Using Ron de Bruin RangetoHTML on multiple macros

    When i do that i get Compile error
    expected variable or procedure not module

  4. #4
    Forum Expert CK76's Avatar
    Join Date
    06-16-2015
    Location
    ONT, Canada
    MS-Off Ver
    MS365 Apps for enterprise
    Posts
    5,897

    Re: Using Ron de Bruin RangetoHTML on multiple macros

    Can you upload sample workbook with desensitized data?

  5. #5
    Forum Contributor
    Join Date
    10-02-2013
    Location
    Houston, TX
    MS-Off Ver
    office 365
    Posts
    638

    Re: Using Ron de Bruin RangetoHTML on multiple macros

    unfortunately this workbook is huge with a ton of code ill try to extrapolate this one out and send it.

    but my code worked fine with
    Please Login or Register  to view this content.
    that was all in one module
    now i split it up and put the html code by itself in a separate module that code was.

    Please Login or Register  to view this content.

    and the range to html is

    Please Login or Register  to view this content.

+ 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] Need Help PLEASE Ambiguous name detected "RangetoHTML
    By bdouglas1011 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-30-2021, 03:22 PM
  2. RangetoHTML function changes formatting of everything after it
    By moe15243 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 07-25-2017, 06:31 PM
  3. Format body in RangetoHTML
    By Rui Farinha in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 11-15-2016, 01:22 PM
  4. RangetoHTML
    By bigpappi23 in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 04-23-2013, 04:10 AM
  5. RangetoHTML issue, Excel 2003
    By bondcrash in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 06-15-2011, 04:51 AM
  6. Setting RANGE for RangeToHTML
    By kmkelley in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-16-2011, 11:08 AM
  7. [SOLVED] Copying Multiple WorkSheets into 1 Workbook - Ron de Bruin Help
    By DanSmoach in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-21-2006, 11:45 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