LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10
Default borders in VBScript

Hi!
I created worksheets from a CSV file using VBScript (Excel 2003).
I want to put a border around the filled cells (UsedRange).
I recorded a macro to put full borders (top, bottom, right, left) and
tried to addapt it to my VBScript.

Where can I get a list of all the xl constants - because they are not
recognized in the VBScript ?
How do I write the code so the borders will work?
Thanks!
Mechi


Set objExcel =
CreateObject("Excel.Application")
Set objWorkbook = objExcel.Workbooks.Add
wsheetNum = 1
Set objSummarySheet = objWorkbook.Worksheets(wsheetNum)
objSummarySheet.Name = "Summary"
....
....
With
objSummarySheet.UsedRange.borders(xlEdgeLeft)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
With objSummarySheet.UsedRange.borders(xlEdgeTop)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
With objSummarySheet.UsedRange.borders(xlEdgeBottom)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
With objSummarySheet.UsedRange.borders(xlEdgeRight)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
With objSummarySheet.UsedRange.borders(xlInsideVertical )
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
With objSummarySheet.UsedRange.borders(xlInsideHorizont al)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to format cell's borders by using VBSCript? htphuoc Excel Programming 2 July 7th 06 08:00 AM
macro will not run from vbscript. help please vedran Excel Programming 2 May 11th 06 03:39 PM
Please help with ADO and VBScript! jenhu[_2_] Excel Programming 1 March 23rd 06 05:06 PM
VBscript sebastienm Excel Programming 0 September 22nd 04 08:24 PM
VBscript raji Excel Programming 0 September 22nd 04 08:03 PM


All times are GMT +1. The time now is 06:37 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"