*Experts* DiverDan Posted September 18, 2005 *Experts* Posted September 18, 2005 I'm having a tough time trying to add an underline border in a specific Excel Worksheet cell and need some help. With excelWorksheet 'blah, blah .Cells(row, col).Borders... it always crashes here End With Thanks, Dan Quote Member, in good standing, of the elite fraternity of mentally challenged programmers. Dolphins Software
SonicBoomAu Posted September 19, 2005 Posted September 19, 2005 Not complete sure about what you are after but this link might help. http://www.xtremedotnettalk.com/showthread.php?t=90660 Hope this helps. Quote Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning. -- Rick Cook, The Wizardry Compiled
*Experts* DiverDan Posted September 19, 2005 Author *Experts* Posted September 19, 2005 Hi SonicBoomAu, I had looked at your previous post earlier and am trying to get the interior border of a single cell as a bottom line. Quote Member, in good standing, of the elite fraternity of mentally challenged programmers. Dolphins Software
SonicBoomAu Posted September 19, 2005 Posted September 19, 2005 Hi DiverDan, Have you tried using .range instead of .cells? Could you apply border around the required cell, then set the border around the ajoining cell to no border? I.E. With objSheet .Range("C2").BorderAround() .Range("B2").BorderAround(BorderStyle.None) .Range("C1").BorderAround(BorderStyle.None) .Range("D2").BorderAround(BorderStyle.None) End With Haven't tried, but I think it would do the job. Not the best but might be able to get you past this spot until someone else knows how to fix. P.S. Just found this web site http://support.microsoft.com/default.aspx?scid=kb;en-us;213622 With range("C2").Borders(Excel.XlUnderlineStyle.xlUnderlineStyleSingle) .Weight = Excel.XlLineStyle.xlContinuous .ColorIndex = 3 End With Hope this helps Quote Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning. -- Rick Cook, The Wizardry Compiled
*Experts* DiverDan Posted September 19, 2005 Author *Experts* Posted September 19, 2005 Thanks SonicBoomAu!!!! This works great for the main lines...I'll work on the individual cells later. With excelWorksheet 'Blah, Blah With .Range("A1:F1").Borders(Excel.XlBordersIndex.xlEdgeBottom) .LineStyle = Excel.XlLineStyle.xlContinuous .Weight = Excel.XlBorderWeight.xlThin .ColorIndex = Excel.XlColorIndex.xlColorIndexAutomatic End With End With I really can't thank you enough as this was the last bit needed for a special report due tommorrow morning at 8:00 am. Thanks, Dan Quote Member, in good standing, of the elite fraternity of mentally challenged programmers. Dolphins Software
SonicBoomAu Posted September 19, 2005 Posted September 19, 2005 No probs DiverDan, Just glad I could help. Quote Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning. -- Rick Cook, The Wizardry Compiled
Recommended Posts