Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hello All,
I would like to write some code that goes through all the worksheets in a book and deletes any "hard-coded" numbers. I would like it to leave all the titles and headings and formulas. Thanks in advance |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi Tim,
Try: Sub TesterA01() Dim ws As Worksheet For Each ws In ActiveWorkbook.Worksheets On Error Resume Next ws.Cells.SpecialCells(xlConstants, _ xlNumbers).Delete On Error GoTo 0 Next ws End Sub --- Regards, Norman "Tim" wrote in message ... Hello All, I would like to write some code that goes through all the worksheets in a book and deletes any "hard-coded" numbers. I would like it to leave all the titles and headings and formulas. Thanks in advance |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi Tim,
Typo: Change Delete to ClearConteb=nts. --- Regards, Norman "Norman Jones" wrote in message ... Hi Tim, Try: Sub TesterA01() Dim ws As Worksheet For Each ws In ActiveWorkbook.Worksheets On Error Resume Next ws.Cells.SpecialCells(xlConstants, _ xlNumbers).Delete On Error GoTo 0 Next ws End Sub --- Regards, Norman "Tim" wrote in message ... Hello All, I would like to write some code that goes through all the worksheets in a book and deletes any "hard-coded" numbers. I would like it to leave all the titles and headings and formulas. Thanks in advance |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Too hasty in correcting the typo!
Change Delete to ClearConteb=nts. Should be: Change Delete to ClearContents The original typo was a stupidity on my part, probably due to a subconscious retention of the the title of your post. --- Regards, Norman "Norman Jones" wrote in message ... Hi Tim, Typo: Change Delete to ClearConteb=nts. --- Regards, Norman "Norman Jones" wrote in message ... Hi Tim, Try: Sub TesterA01() Dim ws As Worksheet For Each ws In ActiveWorkbook.Worksheets On Error Resume Next ws.Cells.SpecialCells(xlConstants, _ xlNumbers).Delete On Error GoTo 0 Next ws End Sub --- Regards, Norman "Tim" wrote in message ... Hello All, I would like to write some code that goes through all the worksheets in a book and deletes any "hard-coded" numbers. I would like it to leave all the titles and headings and formulas. Thanks in advance |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
for each sh in workbook.worksheets
On error resume next sh.cells.specialcells(xlconstants,xlnumbers).Clear Contents On error goto 0 Next would be a start. -- Regards, Tom Ogilvy "Tim" wrote in message ... Hello All, I would like to write some code that goes through all the worksheets in a book and deletes any "hard-coded" numbers. I would like it to leave all the titles and headings and formulas. Thanks in advance |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
delete the test values, but do not delete the formulas | Excel Discussion (Misc queries) | |||
How to Delete a Range in Closed Workbook (to Replace Delete Query) | Excel Discussion (Misc queries) | |||
How do i delete a macro in Excel 2003 when delete isn't highlight | Excel Discussion (Misc queries) | |||
How to delete rows when List toolbar's "delete" isnt highlighted? | Excel Worksheet Functions |