Try this:
This works with a commandbutton on a form or a sheet... It checks if there's something in the first cell, then the cell next to it, and finally the cell two over. If all three have data in them, then it adds the row with borders...:
Private Sub commandbutton1_Click()
If ActiveCell.Value > "" Then
If ActiveCell.Offset(0, 1).Value > "" Then
If ActiveCell.Offset(0, 2).Value > "" Then
Application.ScreenUpdating = False
ActiveCell.Offset(1, 0).Select
ActiveCell.EntireRow.Insert
ActiveCell.Offset(0, 2).Select
Range(Selection, Selection.End(xlToLeft)).Select
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
ActiveCell.Select
Application.ScreenUpdating = True
Else
Exit Sub
End If
Else
Exit Sub
End If
Else
Exit Sub
End If
End Sub
Hope this helps,
Cory
Thanks a bunch Cory..curious about one thing..could you
make it add the row automatically when the 3 cell
filled..thanks again