No Borders

Posted on 2012-08-19
Medium Priority
Last Modified: 2012-08-19
Could someone please help me in removing all borders from all cells in a sheet using vba?
Question by:Stephen Byrom
  • 2
LVL 50

Accepted Solution

Martin Liss earned 2000 total points
ID: 38309959
This should do it in a macro

    Sheet1.Cells.Borders(xlDiagonalDown).LineStyle = xlNone
    Sheet1.Cells.Borders(xlDiagonalUp).LineStyle = xlNone
    Sheet1.Cells.Borders(xlEdgeLeft).LineStyle = xlNone
    Sheet1.Cells.Borders(xlEdgeTop).LineStyle = xlNone
    Sheet1.Cells.Borders(xlEdgeBottom).LineStyle = xlNone
    Sheet1.Cells.Borders(xlEdgeRight).LineStyle = xlNone
    Sheet1.Cells.Borders(xlInsideVertical).LineStyle = xlNone
    Sheet1.Cells.Borders(xlInsideHorizontal).LineStyle = xlNone

Author Closing Comment

by:Stephen Byrom
ID: 38309971
Thanks for your time, works a treat!
LVL 50

Expert Comment

by:Martin Liss
ID: 38309972
You're welcome and I'm glad I was able to help.

Marty - MVP 2009 to 2012

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

This article will guide you to convert a grid from a picture into Excel format using Microsoft OneNote and no other 3rd party application.
This article describes how you can use Custom Document Properties to store settings and other information in your workbook so that they will be available the next time you open the workbook.
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…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

839 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