Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. sponsors. rss.
 From: Cetin Basoz
  Where is Cetin Basoz?
 Izmir
 Turkey
 Cetin Basoz
 To: Russell Hill
  Where is Russell Hill?
 Sydney
 Australia
 Russell Hill
 Tags
Subject: RE: Conditional formatting
Thread ID: 232987 Message ID: 233032 # Views: 39 # Ratings: 2
Version: Visual FoxPro 9 Category: General VFP Topics
Date: Monday, June 29, 2009 1:46:36 PM         
   


If I were you I would be satisfied with borders and/or font and/or interior formatting using FormatConditions collection. If you want to add shapes instead then you can use range's left/top/height/width to find the position (I can't imagine how would that work if data is realtively big):

#Define msoShapeOval	9
#Define xlCenter -4108

oExcel = Createobject('Excel.Application')
With oExcel
  .WorkBooks.Add
  .Visible = .T.

  With .ActiveWorkBook.ActiveSheet
    Local ix, jx
    For ix = 1 To 5
      For jx = 1 To 5
        .Cells(m.ix,m.jx).Value = m.ix*100+m.jx
      Endfor
    Endfor

    .UsedRange.HorizontalAlignment = xlCenter
    .UsedRange.VerticalAlignment = xlCenter
  Endwith
  MarkRange(.ActiveWorkBook.ActiveSheet,.Range('B1'))
  MarkRange(.ActiveWorkBook.ActiveSheet,.Range('B2'))
  MarkRange(.ActiveWorkBook.ActiveSheet,.Range('B3'))
  MarkRange(.ActiveWorkBook.ActiveSheet,.Range('C2'))
  MarkRange(.ActiveWorkBook.ActiveSheet,.Range('E4'))
Endwith

Procedure MarkRange(toSheet,toRange)
  Local loShape
  loShape = toSheet.Shapes.AddShape( msoShapeOval, ;
    toRange.Left-1, toRange.Top-1, ;
    toRange.Width+2, toRange.Height+2)
  loShape.Fill.Transparency = 1
endproc


Cetin Basoz

.Net has got better.Think about moving - check my blog:
Blog (main)
Blog (mirror)



COMPLETE THREAD
Conditional formatting Posted by Russell Hill @ 6/29/2009 1:06:06 AM
RE: Conditional formatting Posted by Cetin Basoz @ 6/29/2009 1:46:36 PM
RE: Conditional formatting Posted by Russell Hill @ 6/29/2009 2:04:07 PM