Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 07-28-2014, 12:35 PM
whatsup whatsup is offline Shorter VBA for creating borders for cells Windows 7 64bit Shorter VBA for creating borders for cells Office 2010 32bit
Competent Performer
 
Join Date: May 2014
Posts: 137
whatsup will become famous soon enough
Default


Hi Mike

If you're fine with the default of borders, you don't have to include all properties. What you've got, is the result of the macro-recorder, which includes the properties to show what's possible.

Still, it's not a lot shorter because borders are applied in sections:

Code:
Sub Do_Borders()
With Range("AG2:AH6")
    .Borders(xlEdgeLeft).LineStyle = xlContinuous
    .Borders(xlEdgeTop).LineStyle = xlContinuous
    .Borders(xlEdgeBottom).LineStyle = xlContinuous
    .Borders(xlEdgeRight).LineStyle = xlContinuous
    .Borders(xlInsideVertical).LineStyle = xlContinuous
    .Borders(xlInsideHorizontal).LineStyle = xlContinuous
End With
End Sub
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
Shorter VBA for creating borders for cells Creating borders in word joechidwala Word 2 02-05-2014 05:33 AM
Shorter VBA for creating borders for cells How to create shorter docs from large base template? Preloader Word 13 10-19-2013 09:39 PM
Shorter VBA for creating borders for cells Differences in borders at page break in merged cells Sudlav Word Tables 2 05-23-2013 11:50 PM
borders disappear from merged cells when pasting from excel joba Word 0 09-10-2012 11:35 AM
Shorter VBA for creating borders for cells PDF conversion creating borders around text BrazzellMarketing Word 4 01-17-2011 01:09 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 12:56 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft