Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Removing formatting around cells after delete

Posted on 2014-09-04
3
Medium Priority
?
96 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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 2000 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

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

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

Do you use a spreadsheet like Microsoft's Excel?  Have you ever wanted to link out to a non excel file on your computer or network drive?  This is the way I found to do it!
Access developers frequently have requirements to interact with Excel (import from or output to) in their applications.  You might be able to accomplish this with the TransferSpreadsheet and OutputTo methods, but in this series of articles I will di…
This Micro Tutorial will demonstrate the scrolling table in Microsoft Excel using the INDEX function.
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

721 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