Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Delete and shift cells up

Status
Not open for further replies.

busy_bee

Programmer
Oct 9, 2020
14
0
0
US
I have the following code to delete a range of cells and shift cells up.

Code:
Set objRange = ws1.Range("C4","C7")
objRange.Delete xlToUp

However, it is giving me an error. Can I get the correct code for this operation?
 
I have figured out the solution.

Code:
const xlUp = -4162
Set objRange = ws1.Range("C4:C7")
objRange.Delete xlUp
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top