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

Excel Joke
Why can't spreadsheets drive cars? They crash too often!

Scott Huish

MrExcel MVP
Joined
Mar 17, 2004
Messages
19,958
Office Version
  1. 365
  2. 2010
Platform
  1. Windows
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
 

Fazza

MrExcel MVP
Joined
May 17, 2006
Messages
9,368
Something like this, maybe. Modify to suit. Regards, Fazza
Code:
Range("A1").CurrentRegion.Resize(, 5).Offset(1).ClearContents
 

Watch MrExcel Video

Forum statistics

Threads
1,130,112
Messages
5,640,173
Members
417,129
Latest member
geekzilla

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
Top