#1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 28
Default Macro Help

I am making a macro that deletes #N/A's, but i want to add a few things to it
that should be deleted:

the phrases "total board" and "total metal", and any non-text (i.e. any
number) that appears.

this is what i have so far:

Public Sub DeleteStuff()
Cells.SpecialCells(xlCellTypeFormulas, xlErrors).Delete
End Sub



what do i add to meet my specifications? thanks.
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
JNW JNW is offline
external usenet poster
 
Posts: 480
Default Macro Help

Try this
Public Sub DeleteStuff()
dim cell as range
Cells.SpecialCells(xlCellTypeFormulas, xlErrors).Deletefor each cell in
cells
if cell.value = "total board" _
or cell.value = "total metal" _
or isnumber(cell.value) = true then
cell.clearcontents
end if
next cell

End Sub


"DFrank" wrote:

I am making a macro that deletes #N/A's, but i want to add a few things to it
that should be deleted:

the phrases "total board" and "total metal", and any non-text (i.e. any
number) that appears.

this is what i have so far:

Public Sub DeleteStuff()
Cells.SpecialCells(xlCellTypeFormulas, xlErrors).Delete
End Sub



what do i add to meet my specifications? thanks.

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
need help to update macro to office 2007 macro enabled workbook jatman Excel Discussion (Misc queries) 1 December 14th 07 01:57 PM
Macro Help Needed - Excel 2007 - Print Macro with Auto Sort Gavin Excel Worksheet Functions 0 May 17th 07 01:20 PM
My excel macro recorder no longer shows up when recording macro jack Excel Discussion (Misc queries) 1 February 5th 07 09:31 PM
My excel macro recorder no longer shows up when recording macro jack Excel Discussion (Misc queries) 3 February 5th 07 08:22 PM
using a cell value to control a counter inside a macro and displaying macro value ocset Excel Worksheet Functions 1 September 10th 06 05:32 AM


All times are GMT +1. The time now is 09:25 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"