MS Excel User defined Macros:
Before creating a user defined macro u will set the security level as either low or medium.
To set the security as low:
Tools->macros->security -> select the option as low as given below.
Creating a new macro for excel sheet:
Tools-->Macro-->Macros-->MacroName(give macroname)---> Create (click on create button)
Once click on create button new macro is created.
Tools-->Macro-->Macros-->Visual Basic Editor (click on this)
click on the visual basic Editor visual basic code window will be open with macro-name procedure.
so write the code for that macro in the code window and click on save button.
Sub border() //here border is macro name
Dim row, irow, row1 As Integer
row = 2
For row1 = row To ActiveSheet.UsedRange.Rows.Count [ no.of rows filled with data in current excel sheet]
If Not Range("B" & row1).Value = "" Then [to give the row top as thick line]
With Range("A" & row1 & ":" & "AT" & row1).Borders(xlEdgeTop)
.LineStyle = xlContinuous
.Weight = xlMedium [to give the row top as thick line]
.ColorIndex = xlAutomatic