+ Reply to Thread
Results 1 to 8 of 8

Macro to data Rows on all sheets except Index and Email

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

    Macro to data Rows on all sheets except Index and Email

    I have tried to write code to find last data before text like "Total" in Col A add 15 rows to this and then delete from this row up to 1 row before text like "Total"

    No rows are being deleted

    I need this to be applied to all sheets except sheet "Index" and Email"


    See my code below

    Please Login or Register  to view this content.
    It would be appreciated if someone could amend my code
    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,454

    Re: Macro to data Rows on all sheets except Index and Email

    Hi Howard...I don't quite understand...Your explanation makes no sense...please elaborate...
    Refer Bad Debts sheet and explain...
    Total is in Row 201...Adding 15 to this makes it 216...What must be deleted and why adding 15?

    Also...Start row will never be less than total row and you cannot delete from starting high to low...will be total row - 1 to start row...
    Please Login or Register  to view this content.
    If you are wanting to delete from Total Row - 1 to lastrow + 15 then...

    Please Login or Register  to view this content.
    Last edited by Sintek; 11-05-2024 at 12:07 PM.
    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 2021
    Posts
    2,841

    Re: Macro to data Rows on all sheets except Index and Email

    My Apologies for being unclear

    I want to find the last row containing data above text like "Total" for e.g. 25 Joihns Road add 15 rows to this and then deleting from this row i.e A47 up to one row before text like "Total"


    If insufficient rows to delete, for a particular sheets then do not delete the rows

    Hope this is clearer

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

    Re: Macro to data Rows on all sheets except Index and Email

    Yes, tx...Try this...
    Please Login or Register  to view this content.
    Last edited by Sintek; 11-05-2024 at 01:00 PM.

  5. #5
    Forum Contributor
    Join Date
    07-12-2018
    Location
    South Africa
    MS-Off Ver
    Office 2021
    Posts
    2,841

    Re: Macro to data Rows on all sheets except Index and Email

    Thanks for your help Sintek

    I do not want the row containing "Total" to be deleted when deleting the rows

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

    Re: Macro to data Rows on all sheets except Index and Email

    See red added snippet - 1 above...

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

    Re: Macro to data Rows on all sheets except Index and Email

    Many Thank Sintek. Code works 100%

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

    Re: Macro to data Rows on all sheets except Index and Email

    Glad to have contributed...Tx for rep +

+ 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] Email range macro shows hidden rows in the email
    By jennis7242 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-09-2019, 11:04 AM
  2. [SOLVED] Email sheets macro errors if no sheets match
    By BPSJACK in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 01-18-2016, 01:21 PM
  3. [SOLVED] VBA - Macro to Copy Data to Other sheets / LOOKUP/INDEX
    By Bloodywog in forum Excel Programming / VBA / Macros
    Replies: 13
    Last Post: 12-16-2015, 05:59 AM
  4. [SOLVED] Using a macro with a lot of data on different, sheets, rows and columns
    By smash96 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 03-11-2014, 06:30 AM
  5. [SOLVED] Need help adjusting VB macro for appending data to rows with matching index numbers
    By summerela in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 05-15-2013, 06:20 PM
  6. Replies: 1
    Last Post: 03-15-2012, 02:24 PM
  7. Replies: 3
    Last Post: 08-07-2011, 06:52 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