Hello everyone,
I ask for help to delete rows:
An alert "how many rows you want to delete?"
example 50
starting from row 5 it eliminates 50 rows
must re-enter the formulas for the automatic number in column A
I hope I explained myself
john
Hello everyone,
I ask for help to delete rows:
An alert "how many rows you want to delete?"
example 50
starting from row 5 it eliminates 50 rows
must re-enter the formulas for the automatic number in column A
I hope I explained myself
john
This one should do
![]()
Please Login or Register to view this content.
Click the * to say thanks.
Hi poul, thanks you
An error if I click cancel or click x goes to debug.
This one should handle that:
![]()
Please Login or Register to view this content.
Hi poul
I did tests.
In the attached example I deleted 200 lines and then in cell A6 / A6 the text of cell A is shown
You've deleted more rows than the ones containing data and last row stops in B5 now, that's why. Try this, untested:
![]()
Please Login or Register to view this content.
Now it does not delete any line always appears
MsgBox ("You have entered an invalid row number")
In a cell type =counta(b6:b200000). This should give you the not empty number of cells. In the macro replace b6:b with b6:b200000. Test it by entering a number smaller that the one returned by the formula first and afterwards one bigger.
i tried:
now in the attach does not delete![]()
Please Login or Register to view this content.
This one will handle the data. Please be aware that will not delete rows if the user imputs a number higher than the rows with data based on B column data. If you want to delete them and to not add data in column A, as B is empty, then remove this part from the code: Or (num > Application.CountA(Range("B6:B200000")))
![]()
Please Login or Register to view this content.
Hi poul,
I entered 125 rows
I tried with delete 123 rows
the macro deletes 123 rows but does not contain the formula in A7
I've replicated your issue and not there should be no more issues.
![]()
Please Login or Register to view this content.
Last edited by PaulM100; 08-13-2019 at 11:45 AM.
![]()
Please Login or Register to view this content.
Poul, I think is now correct.
to be sure I have to try it after the summer holidays.
Greetings and thanks
john
Hi poul,
I tried to change the inputboxes with userform but here I don't know how to insert num in the inputbox.
![]()
Please Login or Register to view this content.
I attach example.
john
Last edited by john_cash; 08-14-2019 at 03:04 AM.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks