PC Review


Reply
Thread Tools Rate Thread

delete error/blank cells

 
 
Ask MS
Guest
Posts: n/a
 
      27th Jun 2008
Happy Friday!

My question is: if a worksheet contains both numerical and error cells, how
can I delete all error cells (not just delete the error contents)
simultanuously?
 
Reply With Quote
 
 
 
 
Gary Brown
Guest
Posts: n/a
 
      27th Jun 2008
vba code:
Cells.SpecialCells(xlCellTypeFormulas, xlErrors).Delete

--
Hope this helps.
If this post was helpfull, please remember to click on the ''''YES''''
button at the bottom of the screen.
Thanks,
Gary Brown


"Ask MS" wrote:

> Happy Friday!
>
> My question is: if a worksheet contains both numerical and error cells, how
> can I delete all error cells (not just delete the error contents)
> simultanuously?

 
Reply With Quote
 
Ask MS
Guest
Posts: n/a
 
      27th Jun 2008
Hi, Gary

Thanks for your quick reply. This is my first time hearing of VBA. Do you
mind give me a brief introduction and how exactly I can get to the
"Cells.SpecialCells(xlCellTypeFormulas, xlErrors).Delete" path in Excel?

Thanks a lot



"Gary Brown" wrote:

> vba code:
> Cells.SpecialCells(xlCellTypeFormulas, xlErrors).Delete
>
> --
> Hope this helps.
> If this post was helpfull, please remember to click on the ''''YES''''
> button at the bottom of the screen.
> Thanks,
> Gary Brown
>
>
> "Ask MS" wrote:
>
> > Happy Friday!
> >
> > My question is: if a worksheet contains both numerical and error cells, how
> > can I delete all error cells (not just delete the error contents)
> > simultanuously?

 
Reply With Quote
 
Gary Brown
Guest
Posts: n/a
 
      30th Jun 2008
1) Open the workbook that you want to work on
2) Go to the worksheet that you want to work on
3) From the top menu, select Tools>Macros>Visual Basic Editor
4) In the left side, you will see a window with the title of 'Project -
VBAProject'
5) In that window, you will see your Excel file name
6) The sheet that you want to work on will probably be highlighted.
7) From the top menu, select Insert>Module
8) The window on the left should now show 'Module1'
9) A blank window should have appeared in the right window
10) in the new blank window on the right, create a procedure called
"DeleteStuff" by typing the following...

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

11) Get back into Excel by selecting from the top menu File>Close and
Return to Microsoft Excel
12) SAVE YOUR WORKBOOK!!!!!!!!!!! because we are about to run the macro
13) From the top menu, select Tools>Macro>Macros
14) Select the macro 'DeleteStuff
15) Select 'Run'

If there are no cells that need to be deleted, you will get an error, but
that's ok.

--
Hope this helps.
If this post was helpfull, please remember to click on the ''''YES''''
button at the bottom of the screen.
Thanks,
Gary Brown


"Ask MS" wrote:

> Hi, Gary
>
> Thanks for your quick reply. This is my first time hearing of VBA. Do you
> mind give me a brief introduction and how exactly I can get to the
> "Cells.SpecialCells(xlCellTypeFormulas, xlErrors).Delete" path in Excel?
>
> Thanks a lot
>
>
>
> "Gary Brown" wrote:
>
> > vba code:
> > Cells.SpecialCells(xlCellTypeFormulas, xlErrors).Delete
> >
> > --
> > Hope this helps.
> > If this post was helpfull, please remember to click on the ''''YES''''
> > button at the bottom of the screen.
> > Thanks,
> > Gary Brown
> >
> >
> > "Ask MS" wrote:
> >
> > > Happy Friday!
> > >
> > > My question is: if a worksheet contains both numerical and error cells, how
> > > can I delete all error cells (not just delete the error contents)
> > > simultanuously?

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Delete Blank Cells in a Row Charles Microsoft Excel Programming 6 10th Mar 2009 10:04 AM
how to delete blank cells between those with entries dumchik Microsoft Excel Worksheet Functions 1 8th Dec 2008 05:13 AM
How do I Delete blank cells in a row Andy in Edinburgh Microsoft Excel Misc 3 5th Sep 2008 05:46 PM
Re: Macro to Delete blank cells Dave Peterson Microsoft Excel Worksheet Functions 0 26th Jan 2006 07:39 PM
Macro to delete all blank cells =?Utf-8?B?QnJpYW4=?= Microsoft Excel Programming 2 15th Dec 2005 12:26 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 10:30 PM.