Thanks! I am not sure what was going on either.
Main Topics
Browse All TopicsI created this from a recorded macro and it has been working up until now now I receive the following error:
Run-time error '1004'
Unable to set the linestyle property of the boarder class.
Sheet11.Columns("C:K").Row
Selection.Borders(xlDiagon
Selection.Borders(xlDiagon
With Selection.Borders(xlEdgeLe
.LineStyle = xlContinuous
.Weight = xlMedium
.ColorIndex = xlAutomatic
End With
With Selection.Borders(xlEdgeTo
.LineStyle = xlContinuous
.Weight = xlMedium
.ColorIndex = xlAutomatic
End With
With Selection.Borders(xlEdgeBo
.LineStyle = xlContinuous
.Weight = xlMedium
.ColorIndex = xlAutomatic
End With
With Selection.Borders(xlEdgeRi
.LineStyle = xlContinuous
.Weight = xlMedium
.ColorIndex = xlAutomatic
End With
Selection.Borders(xlInside
Selection.Borders(xlInside
Sheet11.Columns("C:K").Row
Selection.Borders(xlDiagon
Selection.Borders(xlDiagon
With Selection.Borders(xlEdgeLe
.LineStyle = xlContinuous
.Weight = xlMedium
.ColorIndex = xlAutomatic
End With
With Selection.Borders(xlEdgeTo
.LineStyle = xlContinuous
.Weight = xlMedium
.ColorIndex = xlAutomatic
End With
With Selection.Borders(xlEdgeBo
.LineStyle = xlContinuous
.Weight = xlMedium
.ColorIndex = xlAutomatic
End With
With Selection.Borders(xlEdgeRi
.LineStyle = xlContinuous
.Weight = xlMedium
.ColorIndex = xlAutomatic
End With
Selection.Borders(xlInside
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
Business Accounts
Answer for Membership
by: kenpulsPosted on 2005-01-16 at 23:02:04ID: 13060859
Hi uTab,
s("14:65") t = xlMedium = xlMedium ght = xlMedium ht = xlMedium s("65") t = xlMedium = xlMedium ght = xlMedium ht = xlMedium
I'm not sure why you get the error, as your code ran fine for me. In truth though, the LineStlye property is xlContinuos by default, so that property is not needed. You also have a bunch of other stuff which is extraneous as well, so I've shortened your code a bit.
Give this a shot:
Sub test()
With Sheet11.Columns("C:K").Row
.Borders(xlEdgeLeft).Weigh
.Borders(xlEdgeTop).Weight
.Borders(xlEdgeBottom).Wei
.Borders(xlEdgeRight).Weig
End With
With Sheet11.Columns("C:K").Row
.Borders(xlEdgeLeft).Weigh
.Borders(xlEdgeTop).Weight
.Borders(xlEdgeBottom).Wei
.Borders(xlEdgeRight).Weig
End With
End Sub
Let me know if it doesn't perform as your code used to.
Cheers,
Ken