Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
How to delete same column in every sheet
Is it possible to delete the contents of every column H in the whole work
book using a command button |
#2
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
How to delete same column in every sheet
For each sh In Activeworkbook.Worksheets
sh.Column(8).ClearContents Next sh -- --- HTH Bob __________________________________________ UK Cambridge XL Users Conference 29-30 Nov http://www.exceluserconference.com/UKEUC.html (there's no email, no snail mail, but somewhere should be gmail in my addy) "CP" wrote in message ... Is it possible to delete the contents of every column H in the whole work book using a command button |
#3
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
How to delete same column in every sheet
Looks like it should work but it doesnt
I created a button, viewed the code and inserted this: Private Sub Clear_Click() For Each sh In ActiveWorkbook.Worksheets sh.Column(8).ClearContents Next sh End Sub The Debug screen shows it failing on sh.Column(8).ClearContents object doesnt support this method or property "Bob Phillips" wrote: For each sh In Activeworkbook.Worksheets sh.Column(8).ClearContents Next sh -- --- HTH Bob __________________________________________ UK Cambridge XL Users Conference 29-30 Nov http://www.exceluserconference.com/UKEUC.html (there's no email, no snail mail, but somewhere should be gmail in my addy) "CP" wrote in message ... Is it possible to delete the contents of every column H in the whole work book using a command button |
#4
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
How to delete same column in every sheet
Hi
try inserting sh.activate immediately inside the loop Private Sub Clear_Click() For Each sh In ActiveWorkbook.Worksheets sh.activate sh.Column(8).ClearContents Next sh End Sub -- Regards Roger Govier "CP" wrote in message ... Looks like it should work but it doesnt I created a button, viewed the code and inserted this: Private Sub Clear_Click() For Each sh In ActiveWorkbook.Worksheets sh.Column(8).ClearContents Next sh End Sub The Debug screen shows it failing on sh.Column(8).ClearContents object doesnt support this method or property "Bob Phillips" wrote: For each sh In Activeworkbook.Worksheets sh.Column(8).ClearContents Next sh -- --- HTH Bob __________________________________________ UK Cambridge XL Users Conference 29-30 Nov http://www.exceluserconference.com/UKEUC.html (there's no email, no snail mail, but somewhere should be gmail in my addy) "CP" wrote in message ... Is it possible to delete the contents of every column H in the whole work book using a command button |
#5
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
How to delete same column in every sheet
I had a typo, it should be
For each sh In Activeworkbook.Worksheets sh.Columns(8).ClearContents Next sh -- --- HTH Bob __________________________________________ UK Cambridge XL Users Conference 29-30 Nov http://www.exceluserconference.com/UKEUC.html (there's no email, no snail mail, but somewhere should be gmail in my addy) "CP" wrote in message ... Looks like it should work but it doesnt I created a button, viewed the code and inserted this: Private Sub Clear_Click() For Each sh In ActiveWorkbook.Worksheets sh.Column(8).ClearContents Next sh End Sub The Debug screen shows it failing on sh.Column(8).ClearContents object doesnt support this method or property "Bob Phillips" wrote: For each sh In Activeworkbook.Worksheets sh.Column(8).ClearContents Next sh -- --- HTH Bob __________________________________________ UK Cambridge XL Users Conference 29-30 Nov http://www.exceluserconference.com/UKEUC.html (there's no email, no snail mail, but somewhere should be gmail in my addy) "CP" wrote in message ... Is it possible to delete the contents of every column H in the whole work book using a command button |
#6
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
How to delete same column in every sheet
That got it thanks
"Bob Phillips" wrote: I had a typo, it should be For each sh In Activeworkbook.Worksheets sh.Columns(8).ClearContents Next sh -- --- HTH Bob __________________________________________ UK Cambridge XL Users Conference 29-30 Nov http://www.exceluserconference.com/UKEUC.html (there's no email, no snail mail, but somewhere should be gmail in my addy) "CP" wrote in message ... Looks like it should work but it doesnt I created a button, viewed the code and inserted this: Private Sub Clear_Click() For Each sh In ActiveWorkbook.Worksheets sh.Column(8).ClearContents Next sh End Sub The Debug screen shows it failing on sh.Column(8).ClearContents object doesnt support this method or property "Bob Phillips" wrote: For each sh In Activeworkbook.Worksheets sh.Column(8).ClearContents Next sh -- --- HTH Bob __________________________________________ UK Cambridge XL Users Conference 29-30 Nov http://www.exceluserconference.com/UKEUC.html (there's no email, no snail mail, but somewhere should be gmail in my addy) "CP" wrote in message ... Is it possible to delete the contents of every column H in the whole work book using a command button |
#7
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
How to delete same column in every sheet
Or without VBA...
Select column H Right-click the tab of that sheet Select All Sheets Clear Contents |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Delete rows from one sheet containing deatils on the second sheet | New Users to Excel | |||
Delete rows at end of sheet | Excel Discussion (Misc queries) | |||
delete a sheet is greyed out | Excel Discussion (Misc queries) | |||
What if delete sheet is whited out? | Excel Worksheet Functions | |||
How do I un-delete a sheet? | Excel Discussion (Misc queries) |