Need to Place Border in Cell or Selected Range of Excel 
Author Message
 Need to Place Border in Cell or Selected Range of Excel

VBA suggestion of "With objxl.Selection.borders" does not work in VBS.
Any suggestions?  This is the last item that I need for my project.
Thank you all in advance.

Sent via Deja.com http://www.*-*-*.com/
Before you buy.



Thu, 04 Jul 2002 03:00:00 GMT  
 Need to Place Border in Cell or Selected Range of Excel
Could you post your code?

G. Born

Check out the WSH Bazaar at:

http://ourworld.compuserve.com/homepages/GuenterBorn/index0.htm


Quote:
>VBA suggestion of "With objxl.Selection.borders" does not work in VBS.
>Any suggestions?  This is the last item that I need for my project.
>Thank you all in advance.

>Sent via Deja.com http://www.deja.com/
>Before you buy.



Fri, 05 Jul 2002 03:00:00 GMT  
 Need to Place Border in Cell or Selected Range of Excel
Yes, Thank you.  Here is a small segment, I have a lot more code, but
thought this much would be all you would need. Here is what I am using
to try to perform the desired function. Basically I am plugging
ininformation into 8 cells, then cycling the rows. And every third,
sometimes every fourth, sometimes every row needs to have a "seperator
line" (border)placed on the top edge of that row to serve as a dividing
line between groups.  When starting a new group line, cellfmt() is
called, which right now as a "stop-gap" measure, am using
a "colorization(grey)" method on the selected area as I could not seem
to get at the border objects.  I looked in OLE View, and VBA Object
Viewer, but am not too experienced with either. I know that there must
be a way, but I can't seem to find any references to it.

Sub CellFmt()
                iXLLineS = "A" &(iXLRowVar)
                iXLLineF = "H" &(iXLRowVar)
                iXLLineM =  (iXLLineS) & ":" & (iXLLineF)
                objXL.Range(iXLLineM).Select

                With ObjXL.Selection '.Border(xlEdgeTop)
                        '.LineStyle = xlContinuous
                        '.Weight = xlMedium
                        .Interior.ColorIndex = 15
                End With

TIA,
Greg Armstrong



Quote:
> Could you post your code?

> G. Born

> Check out the WSH Bazaar at:

> http://ourworld.compuserve.com/homepages/GuenterBorn/index0.htm




Quote:
> >VBA suggestion of "With objxl.Selection.borders" does not work in
VBS.
> >Any suggestions?  This is the last item that I need for my project.
> >Thank you all in advance.

> >Sent via Deja.com http://www.deja.com/
> >Before you buy.

Sent via Deja.com http://www.deja.com/
Before you buy.


Sat, 06 Jul 2002 03:00:00 GMT  
 Need to Place Border in Cell or Selected Range of Excel

You need to define the values for xlEdgeTop, et.al.

Const xlEdgeTop = 8
Const xlContinuous = 1
Const xlMedium = -4138

--
Michael Harris
  Yes, Thank you.  Here is a small segment, I have a lot more code, but
  thought this much would be all you would need. Here is what I am using
  to try to perform the desired function. Basically I am plugging
  ininformation into 8 cells, then cycling the rows. And every third,
  sometimes every fourth, sometimes every row needs to have a "seperator
  line" (border)placed on the top edge of that row to serve as a dividing
  line between groups.  When starting a new group line, cellfmt() is
  called, which right now as a "stop-gap" measure, am using
  a "colorization(grey)" method on the selected area as I could not seem
  to get at the border objects.  I looked in OLE View, and VBA Object
  Viewer, but am not too experienced with either. I know that there must
  be a way, but I can't seem to find any references to it.

  Sub CellFmt()
  iXLLineS = "A" &(iXLRowVar)
  iXLLineF = "H" &(iXLRowVar)
  iXLLineM =  (iXLLineS) & ":" & (iXLLineF)
  objXL.Range(iXLLineM).Select

  With ObjXL.Selection '.Border(xlEdgeTop)
  '.LineStyle = xlContinuous
  '.Weight = xlMedium
  .Interior.ColorIndex = 15
  End With

  TIA,
  Greg Armstrong



  > Could you post your code?
  >
  > G. Born
  >
  > Check out the WSH Bazaar at:
  >
  > http://ourworld.compuserve.com/homepages/GuenterBorn/index0.htm
  >


  > >VBA suggestion of "With objxl.Selection.borders" does not work in
  VBS.
  > >Any suggestions?  This is the last item that I need for my project.
  > >Thank you all in advance.
  > >
  > >
  > >Sent via Deja.com http://www.deja.com/
  > >Before you buy.
  >
  >

  Sent via Deja.com http://www.deja.com/
  Before you buy.



Sat, 06 Jul 2002 03:00:00 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. Selecting Range and then Setting the Borders collection

2. Change border thickness on individual table cell ?

3. Border color on empty table cells

4. selecting page ranges from a postscript file

5. set range propeties in excel

6. Excel Range

7. Select Case range

8. read Image Attributes over selected Range

9. Find value i Excel range

10. Excel Application and VB Script Error 800A000D (Type Mismatch :Range)

11. Calling range.sort in Excel from VBScript...

12. "subscript out of range" - Excel

 

 
Powered by phpBB® Forum Software