axnst2
asked on
Changing Excel cell border from code
Hi Experts,
I create Excel documents from VB 6.0 and I need to know the following:
How do I change the border of a cell from code?
Thanks,
axnst2
I create Excel documents from VB 6.0 and I need to know the following:
How do I change the border of a cell from code?
Thanks,
axnst2
ASKER
The thick line at the bottom of the cell
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Assuming you have the Excel library referenced, you can get the constants used above by qualifying with the Excel object:
Excel.XlBordersIndex.xlEdg eTop
If not, here are the declarations:
Public Enum XlBorderWeight
xlHairline = 1
xlMedium = -4138
xlThick = 4
xlThin = 2
End Enum
Public Enum XlBordersIndex
xlInsideHorizontal = 12
xlInsideVertical = 11
xlDiagonalDown = 5
xlDiagonalUp = 6
xlEdgeBottom = 9
xlEdgeLeft = 7
xlEdgeRight = 10
xlEdgeTop = 8
End Enum
Kevin
Excel.XlBordersIndex.xlEdg
If not, here are the declarations:
Public Enum XlBorderWeight
xlHairline = 1
xlMedium = -4138
xlThick = 4
xlThin = 2
End Enum
Public Enum XlBordersIndex
xlInsideHorizontal = 12
xlInsideVertical = 11
xlDiagonalDown = 5
xlDiagonalUp = 6
xlEdgeBottom = 9
xlEdgeLeft = 7
xlEdgeRight = 10
xlEdgeTop = 8
End Enum
Kevin
I need to do more spell checking...
Kevin
Kevin
ASKER
All I basically want to do is set the buttom border and that it so that I can underline my sub totals. Do I still have to go throug all of this?
Nope:
TargetRange.Borders(9).Col orIndex = 1
Kevin
TargetRange.Borders(9).Col
Kevin
ASKER
Kevin,
How exactly would this look in code? Please assume that I know nothing about working with Excel from VB 6.0 (which happens to be the truth)?
Thanks a bunch,
axnst2
How exactly would this look in code? Please assume that I know nothing about working with Excel from VB 6.0 (which happens to be the truth)?
Thanks a bunch,
axnst2
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
How do I create a range?
ASKER
Never mind...I got it...thanks a bunch Gentlemen!
What border formatting do you want?
Regards,
Patrick