C
crapit
What's wrong?
With Worksheets("Recent")
Range(Cells(1, 1), Cells(1, 2)).Font.FontStyle = "Bold"
End with
With Worksheets("Recent")
Range(Cells(1, 1), Cells(1, 2)).Font.FontStyle = "Bold"
End with
Dave Peterson said:Without seeing the code....
Is the worksheet protected?
absolutely NO!
The sub-procedure is called from another sub. Btw, how to check that a
procedure has completely executed its codes b4 other sub-procedure carry on
sub setup()
...
Other codes
...
Worksheets("Reply").Activate
Range(Cells(1, 1), Cells(lastrow, 6)).Select
borders
end sub
Sub borders
Selection.Borders(xlDiagonalDown).LineStyle = xlNone
Selection.Borders(xlDiagonalUp).LineStyle = xlNone
With Selection.Borders(xlEdgeLeft)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
With Selection.Borders(xlEdgeTop)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
With Selection.Borders(xlEdgeBottom)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
With Selection.Borders(xlEdgeRight)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
With Selection.Borders(xlInsideVertical)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
With Selection.Borders(xlInsideHorizontal)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
end sub
As I use border function on two worksheets, the 1st sheet work fine, but the
2nd doesnt. And the error happen at
With Selection.Borders(xlInsideHorizontal)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
Never mind, I solve it.
But I run into this problem
Run- time error '1004'
Select method of range class failed
~~~~~~~~~~~~~~Codes~~~~~~~~
With Worksheets("Repeat")
.Rows("1:1").Select <----Error Highlight
With Selection
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlCenter
.WrapText = True
End With
Selection.Font.Bold = True
Cells.Select
With Selection.Font
.Size = 16
End With
End with