Shift Content Up..

Nielinki

New Member
Joined
Mar 3, 2025
Messages
18
Office Version
  1. 365
Platform
  1. Windows
Hi there..
Is there some way in VBA to go through the Range from N16:Q70 and find the blank row, and copy paste the cells underneath it up?
I have tried using the Delete Row to Shift xlUp but it makes such a mess on the sides of this Range where I have buttons and text boxes..
Screenshot 2025-03-14 075220.png
 
You can do a delete manually or with code without deleting the entire row if you have no other blank cells in the range (as per your image) and the cells are genuinely blank/empty with Specialcells blanks

VBA Code:
Range("N16:Q70").SpecialCells(xlCellTypeBlanks).Delete xlUp
 
Upvote 0
You can do a delete manually or with code without deleting the entire row if you have no other blank cells in the range (as per your image) and the cells are genuinely blank/empty with Specialcells blanks

VBA Code:
Range("N16:Q70").SpecialCells(xlCellTypeBlanks).Delete xlUp
Thank you for the answer.. When I use that though it does remove the entire row and makes the spacing between my other shapes wrong..
 

Attachments

  • Screenshot 2025-03-14 111348.png
    Screenshot 2025-03-14 111348.png
    6.1 KB · Views: 7
  • Screenshot 2025-03-14 111355.png
    Screenshot 2025-03-14 111355.png
    22.7 KB · Views: 6
  • Screenshot 2025-03-14 111410.png
    Screenshot 2025-03-14 111410.png
    13.3 KB · Views: 7
Upvote 0
If you have other ranges with formulas into that range, that will cause problems if you delete the cells those formulas are referencing. You would have to clean up all the other ranges too.
Why do you even have blank spaces in the original range in the first place?
How about just sort your range to get the blank items to the bottom?
 
Upvote 0
It is a POS.. When I use the Delete code it also removes my -+ Icons on the same line causing other kind of code errors..
 

Attachments

  • Screenshot 2025-03-14 112332.png
    Screenshot 2025-03-14 112332.png
    196.6 KB · Views: 9
Upvote 0
Why do you even have blank spaces in the original range in the first place?
How about just sort your range to get the blank items to the bottom?
 
Upvote 0
If the customer changes their mind about a drink, the delete icon removes it from the bill..
 
Upvote 0
You still have not answered my last question; if that would be a feasible solution.
 
Upvote 0
After I save the order it adds the DB Rows so now it is adding the Row even for the blanks..
So shifting them to the bottom wouldn't work cause it will still be adding those DB Row numbers to the Ordered Items where the receipt saves..

Screenshot 2025-03-14 163836.png
Screenshot 2025-03-14 163857.png
 
Upvote 0

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top