View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
KevinF KevinF is offline
external usenet poster
 
Posts: 1
Default SCripting Border in Excel

I am writing a script to populate an excel speadsheet.

All works ok until I try and but borders around the results.

The snipet of code below is how I have tried to create the borders but with
ne results.

with (Report.Range(Cells(ExcelRow,2),Cells(EndRow,6)).B orders(xlEdgeLeft))
{
LineStyle = xlContinuous;
Weight = xlThick;
ColorIndex = xlAutomatic;
}
with
(Report.Range(Cells(ExcelRow,2),Cells(EndRow,6)).B orders(xlEdgeRight))
{
LineStyle = xlContinuous;
Weight = xlThick;
ColorIndex = xlAutomatic;
}

with (Report.Range(Cells(ExcelRow,2),Cells(EndRow,6)).B orders(xlEdgeLeft))
{
LineStyle = xlContinuous;
Weight = xlThick;
ColorIndex = xlAutomatic;
}

with (Report.Range(Cells(ExcelRow,2),Cells(EndRow,6)).B orders(xlEdgeTop))
{
LineStyle = xlContinuous;
Weight = xlThick;
ColorIndex = xlAutomatic;
}

with
(Report.Range(Cells(ExcelRow,2),Cells(EndRow,6)).B orders(xlEdgeBottom))
{
LineStyle = xlContinuous;
Weight = xlThick;
ColorIndex = xlAutomatic;
}

with
(Report.Range(Cells(ExcelRow,2),Cells(EndRow,6)).B orders(xlInsideHorizontal))
{
LineStyle = xlContinuous;
Weight = xlThick;
ColorIndex = xlAutomatic;
}

with
(Report.Range(Cells(ExcelRow,2),Cells(EndRow,6)).B orders(xlInsideVertical))
{
LineStyle = xlContinuous;
Weight = xlThick;
ColorIndex = xlAutomatic;
}

The problem appears to be with the Range statement.
Can anyone over advise?

Regards

Kevin