Deleting rows and columns resulting in black line

Prabs8291

New Member
Joined
Sep 21, 2013
Messages
5
I have a peculiar problem... I am trying to delete the contents of all the rows and columns beyond some row... I am using the below macro for that... The contents are cleared successfully but a black line is produced. Please help !!!
frown.gif



Sub CLEAR_REPORT()
Sheets("Report").Select
Rows("8:8").Select
Range("A8").Activate
Range(Selection, Selection.End(xlDown)).Select
Selection.Delete Shift:=xlUp
End Sub
 

Excel Facts

Select all contiguous cells
Pressing Ctrl+* (asterisk) will select the "current region" - all contiguous cells in all directions.
Try:

Sheets("Report").Range("8:" & sheets("Report").rows.count).Delete Shift:=xlUp
 
Upvote 0
Hi nuked,

Thanks for the reply....the code given by you clears the contents but the black line is again coming :(
 
Upvote 0
Do you have or had any shapes or other objects on the sheet?
If you have try...

Ctrl-G – Select – Objects – OK – Delete
 
Last edited:
Upvote 0

Forum statistics

Threads
1,216,095
Messages
6,128,790
Members
449,468
Latest member
AGreen17

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