ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   add line during code (https://www.excelbanter.com/excel-programming/335087-add-line-during-code.html)

Brenda

add line during code
 
I am trying to have a line put in after I do this coding:

.Cells(intRow + rowCount + 2, intColumn + 10).Value = "=(I" & total_RowCOGS
& "/I" & total_IncRow & ")*.01"
..Cells(intRow + rowCount + 2, intColumn + 10).NumberFormat = "0.00%"
..Cells(intRow + rowCount + 2, intColumn + 10).Font.Bold = True

I've tried this but NO luck:

..Cells(intRow + rowCount + 2, intColumn +
10).Borders.get_Item(Excel.XlBordersIndex.xlEdgeTo p).LineStyle =
Excel.XlLineStyle.xlContinuous

Any ideas? I really would like to add this feature in. Thanks!


--
Brenda

ben

add line during code
 
first off are you coding directly in excel or is another application handling
this sub?

..Cells(intRow + rowCount + 2, intColumn +
10).Borders(xlEdgeTop).LineStyle = xlContinuous

if this is in a with end with loop it should work.
but it will only work for one cell are you trying to add it to a range of
cells?


--
When you lose your mind, you free your life.


"Brenda" wrote:

I am trying to have a line put in after I do this coding:

.Cells(intRow + rowCount + 2, intColumn + 10).Value = "=(I" & total_RowCOGS
& "/I" & total_IncRow & ")*.01"
.Cells(intRow + rowCount + 2, intColumn + 10).NumberFormat = "0.00%"
.Cells(intRow + rowCount + 2, intColumn + 10).Font.Bold = True

I've tried this but NO luck:

.Cells(intRow + rowCount + 2, intColumn +
10).Borders.get_Item(Excel.XlBordersIndex.xlEdgeTo p).LineStyle =
Excel.XlLineStyle.xlContinuous

Any ideas? I really would like to add this feature in. Thanks!


--
Brenda


Brenda

add line during code
 
I am using VB.NET. When I run it, it gives me this error:

Additional information: Public member 'XlBordersIndex' on type
'ApplicationClass' not found.

Any ideas why?

--
Brenda


"ben" wrote:

first off are you coding directly in excel or is another application handling
this sub?

.Cells(intRow + rowCount + 2, intColumn +
10).Borders(xlEdgeTop).LineStyle = xlContinuous

if this is in a with end with loop it should work.
but it will only work for one cell are you trying to add it to a range of
cells?


--
When you lose your mind, you free your life.


"Brenda" wrote:

I am trying to have a line put in after I do this coding:

.Cells(intRow + rowCount + 2, intColumn + 10).Value = "=(I" & total_RowCOGS
& "/I" & total_IncRow & ")*.01"
.Cells(intRow + rowCount + 2, intColumn + 10).NumberFormat = "0.00%"
.Cells(intRow + rowCount + 2, intColumn + 10).Font.Bold = True

I've tried this but NO luck:

.Cells(intRow + rowCount + 2, intColumn +
10).Borders.get_Item(Excel.XlBordersIndex.xlEdgeTo p).LineStyle =
Excel.XlLineStyle.xlContinuous

Any ideas? I really would like to add this feature in. Thanks!


--
Brenda



All times are GMT +1. The time now is 12:09 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com