+ Reply to Thread
Results 1 to 11 of 11

Macro to send files

  1. #1
    Forum Contributor
    Join Date
    02-13-2014
    Location
    India
    MS-Off Ver
    Excel 2013
    Posts
    140

    Macro to send files

    Hi,

    PFA my macro files.

    I am getting an error on line

    .AutoFill .Resize(LastRow2 - 4, 1), xlFillSeries

    can any one help me?
    Attached Files Attached Files

  2. #2
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,480

    Re: Macro to send files

    You Have
    Please Login or Register  to view this content.
    LastRow2=4
    so 4-4=0

  3. #3
    Forum Contributor
    Join Date
    02-13-2014
    Location
    India
    MS-Off Ver
    Excel 2013
    Posts
    140

    Re: Macro to send files

    I didnt get u

  4. #4
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,480

    Re: Macro to send files

    how can you autofill 0 rows?

  5. #5
    Forum Contributor
    Join Date
    02-13-2014
    Location
    India
    MS-Off Ver
    Excel 2013
    Posts
    140

    Re: Macro to send files

    can you please give me modified code?

  6. #6
    Forum Contributor
    Join Date
    02-13-2014
    Location
    India
    MS-Off Ver
    Excel 2013
    Posts
    140

    Re: Macro to send files

    Can u give me the code to move next line if rows are zero

  7. #7
    Forum Contributor
    Join Date
    02-13-2014
    Location
    India
    MS-Off Ver
    Excel 2013
    Posts
    140

    Re: Macro to send files

    Can u give me the code to move next line if rows are zero.

    Means to reach line MsgBox "Aditya_Birla GMC/GPA- The selection is not a range or the sheet is protected

  8. #8
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,480

    Re: Macro to send files

    I don't know what you are doing.

    You are creating a sheet, then placing text in row 4, then you are trying to find the last row in the sheet, and it will always be the fourth row so the last row-4 will always be zero.

  9. #9
    Forum Contributor
    Join Date
    02-13-2014
    Location
    India
    MS-Off Ver
    Excel 2013
    Posts
    140

    Re: Macro to send files

    Dear Dave,
    My code does below task.

    in sheet Data, code extracts date from J to F. It creates sheet Results.

    Then in sheet Data, in J, below Code filters records begin with Resolved and Sent

    If WorksheetFunction.CountIfs(Sheets("Data").Range("J1:J" & LastRow1), "=Resolved*") > 0 Or WorksheetFunction.CountIfs(Sheets("Data").Range("J1:J" & LastRow1), "=Sent*") > 0 Then

    also has other filter criteria.

    if records found then it goes to next line. If no record found then below msg to be displayed.

    MsgBox "Aditya_Birla GMC/GPA- The selection is not a range or the sheet is protected.

  10. #10
    Forum Contributor
    Join Date
    02-13-2014
    Location
    India
    MS-Off Ver
    Excel 2013
    Posts
    140

    Re: Macro to send files

    Means if there is no records found in filter criteria then move to

    If rng Is Nothing Then

    If rng Is Nothing Then
    '''''''''''''''' Change name of the entity
    MsgBox "Aditya_Birla GMC/GPA- The selection is not a range or the sheet is protected. " & _
    vbNewLine & "Please correct and try again.", vbOKOnly

  11. #11
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,480

    Re: Macro to send files

    Okay, I see what ids going on,. You need a little error trap in case there is nothing to copy.
    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] Adjust email macro to send only select files in a folder rather than all ref'ed in a range
    By Groovicles in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-12-2016, 07:37 PM
  2. Macro To Check For Files in Specfic Paths and Send out Email
    By takeawalkk in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 07-04-2016, 09:59 AM
  3. Vba to send files via outlook issue
    By thaykhov in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-08-2015, 06:04 AM
  4. Can Macro send already made PDFs files ?
    By bimo in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-08-2015, 05:39 PM
  5. Macro to: Send different PDF files to different receipient
    By reach78 in forum Outlook Programming / VBA / Macros
    Replies: 4
    Last Post: 09-26-2013, 02:29 AM
  6. Macro to send data from one file to multiple other existing files
    By masben in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 01-09-2013, 05:21 AM
  7. Send XL files via Outlook and NHS.net
    By pixifaery in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 10-05-2010, 10:22 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