+ Reply to Thread
Results 1 to 12 of 12

Email Sheet based on Sheet namesin Col A on sheet "Macro"

  1. #1
    Forum Contributor
    Join Date
    07-12-2018
    Location
    South Africa
    MS-Off Ver
    Office 2024
    Posts
    2,873

    Email Sheet based on Sheet namesin Col A on sheet "Macro"

    I have tried to write code to email those sheets that are in Col A o sheet "Macro"

    It would be appreciated if someone can help me resolve this

    Please Login or Register  to view this content.
    Attached Files Attached Files

  2. #2
    Forum Guru Sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2019 | 2021
    Posts
    14,958

    Re: Email Sheet based on Sheet namesin Col A on sheet "Macro"

    Please Login or Register  to view this content.
    Good Luck...
    I don't presume to know what I am doing, however, just like you, I too started somewhere...
    One-day, One-problem at a time!!!
    If you feel I have helped, please click on the [★ Add Reputation] to left of post window...
    Also....Add a comment if you like!!!!
    And remember...Mark Thread as Solved...
    Excel Forum Rocks!!!

  3. #3
    Forum Contributor
    Join Date
    07-12-2018
    Location
    South Africa
    MS-Off Ver
    Office 2024
    Posts
    2,873

    Re: Email Sheet based on Sheet namesin Col A on sheet "Macro"

    Hi Sintek

    Thanks for the help. I have made the necessary changes. When running the macro , I now het run time error 1004 and the code below is highlighted


    [codde].SaveAs Filename:=File, FileFormat:=51 [/code]


    Kind Test & advise

  4. #4
    Forum Guru bakerman2's Avatar
    Join Date
    10-03-2012
    Location
    Antwerp, Belgium
    MS-Off Ver
    MSO Home and Business 2024
    Posts
    7,333

    Re: Email Sheet based on Sheet namesin Col A on sheet "Macro"

    Please Login or Register  to view this content.
    Avoid using Select, Selection and Activate in your code. Use With ... End With instead.
    You can show your appreciation for those that have helped you by clicking the * at the bottom left of any of their posts.

  5. #5
    Forum Guru Sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2019 | 2021
    Posts
    14,958

    Re: Email Sheet based on Sheet namesin Col A on sheet "Macro"

    I don't get it...This file has nothing to do with your initial request...
    And no such code exists...
    Please Login or Register  to view this content.
    If you are referring to your first upload then the code errors as there is no reference to your variable "File"....

    So incorporate something like this...
    Please Login or Register  to view this content.
    Last edited by Sintek; 04-26-2020 at 03:14 AM.

  6. #6
    Forum Contributor
    Join Date
    07-12-2018
    Location
    South Africa
    MS-Off Ver
    Office 2024
    Posts
    2,873

    Re: Email Sheet based on Sheet namesin Col A on sheet "Macro"

    Hi Sintek


    Thanks for the help, code works perfectly

    I have formulas in A onwards to only show sheets where there are variances and those with no variance as shown as a blank

    I there a way to increase the range of the array so that when there is a variance on another sheet , that sheet will also be included on the attachment ?

    If so, please amend code

    I tried to increase the range, where cell A5 is displaying blank , but get a run time error

    Please Login or Register  to view this content.

  7. #7
    Forum Contributor
    Join Date
    07-12-2018
    Location
    South Africa
    MS-Off Ver
    Office 2024
    Posts
    2,873

    Re: Email Sheet based on Sheet namesin Col A on sheet "Macro"

    Thanks for your help, Bakerman2

  8. #8
    Forum Guru Sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2019 | 2021
    Posts
    14,958

    Re: Email Sheet based on Sheet namesin Col A on sheet "Macro"

    Howard...I'm confused...What file are you referring to...

    Seems you have two individual requirements | 2 individual files running same thread

    I tried to increase the range, where cell A5 is displaying blank , but get a run time error
    Cannot refer to a sheet if there is no name allocated to it...
    Last edited by Sintek; 04-26-2020 at 05:57 AM.

  9. #9
    Forum Contributor
    Join Date
    07-12-2018
    Location
    South Africa
    MS-Off Ver
    Office 2024
    Posts
    2,873

    Re: Email Sheet based on Sheet namesin Col A on sheet "Macro"

    Sinek, sorry for any confusion caused

    I amended my sample file slightly , as I would like the array range to increase as the range increases in Col A with the sheetnames-see attached sample data

  10. #10
    Forum Guru Sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2019 | 2021
    Posts
    14,958

    Re: Email Sheet based on Sheet namesin Col A on sheet "Macro"

    Amend code to Incorporate...
    Please Login or Register  to view this content.

  11. #11
    Forum Contributor
    Join Date
    07-12-2018
    Location
    South Africa
    MS-Off Ver
    Office 2024
    Posts
    2,873

    Re: Email Sheet based on Sheet namesin Col A on sheet "Macro"

    Hi Sintek

    This is brilliant. Works like a charm

    Thanks very much for your help once again

  12. #12
    Forum Guru Sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2019 | 2021
    Posts
    14,958

    Re: Email Sheet based on Sheet namesin Col A on sheet "Macro"

    ..........................
    Image 1.gif

+ 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] Renaming sheet based on sheet where "new sheet" code originated from
    By Vegiepie2016 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 01-28-2016, 05:55 AM
  2. Looping thru rows and copy cell values from "Inputs" sheet to "Output" sheet
    By hariexcel1987 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-02-2015, 11:32 PM
  3. macro to email a sheet via "outlook web mail"
    By erik915 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 08-31-2015, 12:59 PM
  4. Copying all Datas in another sheet based if "Order Received" Synchonized in other sheet
    By Heide Rayos in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 12-01-2014, 01:44 PM
  5. Script not copying data from "Emails" sheet to "New Sheet" - Run time error: Object
    By methuselah90 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-08-2014, 03:22 PM
  6. Replies: 3
    Last Post: 05-31-2013, 05:16 AM
  7. Extract list from sheet "A" to sheet "B# based on certain criteria
    By lysaar in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-19-2013, 01:58 PM

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