Macro for deleting a list

stevenvanderkruk

New Member
Joined
Jul 26, 2007
Messages
4
Hello,

can someone please help me to create a macro for deletion of "list" content. I want to be able to delete the content of the first 5 or 6 columns of the list for row two untill the end of the list.

Thank you so much.

This forum is great.

Kind regards,

Steven
 

Excel Facts

Highlight Duplicates
Home, Conditional Formatting, Highlight Cells, Duplicate records, OK to add pink formatting to any duplicates in selected range.
I'm not sure what you mean by row 2 till the end of the list. If it's just row 2 and only for 5 or 6 columns, how is this to the end of the list?

I've never worked with Lists, but this seemed to work for me.

Data, List, Convert to Range
Click Yes
Delete the Cells you don't want.
Select your range
Data List, Create List
Click OK.

In a macro, perhaps something like this, (change ranges as necessary):
Code:
Sub Macro1()
ActiveSheet.ListObjects("List1").Unlist
Range("A2:E2").Delete Shift:=xlUp
ActiveSheet.ListObjects.Add(xlSrcRange, Range("$A$1:$I$16"), , xlYes).Name = "List1"
End Sub
 
Upvote 0
Something like this, maybe. Modify to suit. Regards, Fazza
Code:
Range("A1").CurrentRegion.Resize(, 5).Offset(1).ClearContents
 
Upvote 0

Forum statistics

Threads
1,217,440
Messages
6,136,627
Members
450,022
Latest member
Joel1122331

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