+ Reply to Thread
Results 1 to 8 of 8

Vba code at least keep 2 rows

  1. #1
    Forum Contributor
    Join Date
    07-14-2019
    Location
    Dubai
    MS-Off Ver
    2019
    Posts
    919

    Vba code at least keep 2 rows

    Hello

    This is TABLE1


    as seen now table1 has 10 rows,is there any code I put it in worksheet change sub or anywhere, that keep at least two rows inside the table if user/macro try to delete rows ?
    i dont want to lock 2 rows, because when locked i got errors from macros, i just need the code to keep at least 2 rows

    Thanks

    key = 1
    Attached Files Attached Files
    Last edited by Undo; 07-30-2019 at 09:21 AM.

  2. #2
    Forum Expert Pepe Le Mokko's Avatar
    Join Date
    05-14-2009
    Location
    Belgium
    MS-Off Ver
    O365 v 2402
    Posts
    13,448

    Re: Vba code at least keep 2 rows

    Please post your sheet and code on the forum. External links are unsafe and not all our members can access them.
    Thanks

  3. #3
    Forum Contributor
    Join Date
    07-14-2019
    Location
    Dubai
    MS-Off Ver
    2019
    Posts
    919

    Re: Vba code at least keep 2 rows

    as the photo i sent it above, i use this code to delete table1 blank rows
    Please Login or Register  to view this content.
    i want if all rows blank, dont delete all rows, at least keep 2 rows , now its deleting all



    thanks
    Last edited by Undo; 07-30-2019 at 09:20 AM.

  4. #4
    Forum Expert Pepe Le Mokko's Avatar
    Join Date
    05-14-2009
    Location
    Belgium
    MS-Off Ver
    O365 v 2402
    Posts
    13,448

    Re: Vba code at least keep 2 rows

    Hi
    please post your sheet on the board ( Go advanced - Manage attachments). External links are notoriously unsafe and might not be accessible to all our members, depriving you from valuable help.
    Thanks

  5. #5
    Forum Contributor
    Join Date
    07-14-2019
    Location
    Dubai
    MS-Off Ver
    2019
    Posts
    919

    Re: Vba code at least keep 2 rows

    thanks bro.. i know about attacmnet.. but its never work for me
    when i click attachment nothing happen.. only i can attach by phoot button

  6. #6
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,869

    Re: Vba code at least keep 2 rows

    Unfortunately the attachment icon doesn't work at the moment (it hasn't worked for years), so to attach an Excel file you have to do the following: just before posting, scroll down to Go Advanced and then scroll down to Manage Attachments. Now follow the instructions at the top of that screen.
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  7. #7
    Forum Expert Pepe Le Mokko's Avatar
    Join Date
    05-14-2009
    Location
    Belgium
    MS-Off Ver
    O365 v 2402
    Posts
    13,448

    Re: Vba code at least keep 2 rows

    Quote Originally Posted by e97h View Post
    thanks bro.. i know about attacmnet.. but its never work for me
    when i click attachment nothing happen.. only i can attach by phoot button
    It was already explained to you in my post in your thread https://www.excelforum.com/excel-pro...ml#post5165585

    (and please leave familiarities out.Thank you)

  8. #8
    Forum Contributor
    Join Date
    07-14-2019
    Location
    Dubai
    MS-Off Ver
    2019
    Posts
    919

    Re: Vba code at least keep 2 rows

    thx,edited

+ 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] copy rows out of a datasheet based on a code number and past these rows in a new sheet
    By Robert1311 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 04-11-2018, 11:41 AM
  2. [SOLVED] Need VBA code to lookup vaue through micr code copy matching rows to under group
    By johnmacpro in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-08-2016, 12:25 AM
  3. need vba code to split rows to closed wb shets depends company code met with sht name
    By julielara in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-18-2016, 12:44 PM
  4. [help with code] need to update existing code to copy and keep rows on input page
    By scott micklo in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-25-2016, 01:36 PM
  5. Need VBA Code to Ignore Hidden Rows Page Break (Rows Grouped/Ungrouped)
    By Photosweet2006 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 01-28-2015, 11:48 AM
  6. Replies: 9
    Last Post: 05-24-2013, 01:31 PM
  7. Code to delete rows based on status code in Column I
    By LemonTwist in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 07-26-2009, 07:01 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