Solved

Removing formatting around cells after delete

Posted on 2014-09-04
3
83 Views
Last Modified: 2014-09-05
Experts,

I have a spreadsheet that I am deleting rows if the value of all the columns is zero.  Column "C" on the spreadsheet has a value and the value is being deleted but the formatting around the cell (all four borders) remains.   Everything else on the row is deleted.

How can I delete the formatting in column "C'
0
Comment
Question by:morinia
  • 2
3 Comments
 
LVL 27

Expert Comment

by:Glenn Ray
ID: 40304968
Use the "Clear All" command:
Clear All - menu
In VBA:
Selection.Clear

Open in new window


Regards,
-Glenn
0
 

Author Comment

by:morinia
ID: 40304987
GLEN,

If I have this command to delete the row

 Rows(i).Delete

How would I code Selection.Clear  as you have above
0
 
LVL 27

Accepted Solution

by:
Glenn Ray earned 500 total points
ID: 40305108
As so:
Rows(i).Clear

The equivalent of the [Delete] command that removes cell contents only is:
Rows(i).ClearContents
0

Featured Post

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Introduction This Article briefly covers methods of calculating the NPV and IRR variants in Excel as well as the limitations in calculating and interpreting IRR results. Paraphrasing Richard Shockley, author of my favourite finance reference tex…
Improved? Move/Copy Add-in Replacement - How to avoid the annoying, “A formula or sheet you want to move or copy contains the name XXX, which already exists on the destination worksheet.” David Miller (dlmille)  It was one of those days… I wa…
This Micro Tutorial demonstrates how to create Excel charts: column, area, line, bar, and scatter charts. Formatting tips are provided as well.
Many functions in Excel can make decisions. The most simple of these is the IF function: it returns a value depending on whether a condition you describe is true or false. Once you get the hang of using the IF function, you will find it easier to us…

820 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question