Sub Due_Date()
Dim myArray() As Variant
Dim lastRopw As Integer
Dim lastCol As Integer
With Worksheets("Input")
lastRow = .Cells(.Rows.Count, "A").End(xlUp).Row
lastCol = .Cells(1, .Columns.Count).End(xlToLeft).Column
End With
Worksheets("Input").Select
myArray = Range("A1").CurrentRegion
Worksheets("Output").Select
With Sheets("Output")
.Cells(1, 1) = "Sl. No."
.Cells(1, 2) = "Name Of The Customer"
.Cells(1, 3) = "Due Date"
.Cells(1, 4) = "Remarks"
For j = 3 To lastCol
For i = 2 To lastRow
.Cells((j - 3) * 4 + i, 1) = myArray(i, 1)
.Cells((j - 3) * 4 + i, 2) = myArray(i, 2)
.Cells((j - 3) * 4 + i, 3) = myArray(i, 3)
.Cells((j - 3) * 4 + i, 4) = myArray(1, j)
Next i
Next j
End With
With Range("A1").CurrentRegion
.Borders(xlDiagonalDown).LineStyle = xlNone
.Borders(xlDiagonalUp).LineStyle = xlNone
.Borders(xlEdgeLeft).LineStyle = xlNone
.Borders(xlEdgeTop).LineStyle = xlNone
.Borders(xlEdgeBottom).LineStyle = xlNone
.Borders(xlEdgeRight).LineStyle = xlNone
.Borders(xlInsideVertical).LineStyle = xlNone
.Borders(xlInsideHorizontal).LineStyle = xlNone
End With
With Range("A1").CurrentRegion
With .Borders(xlEdgeLeft)
.LineStyle = xlContinuous
.ColorIndex = 0
.TintAndShade = 0
.Weight = xlThin
End With
With .Borders(xlEdgeTop)
.LineStyle = xlContinuous
.ColorIndex = 0
.TintAndShade = 0
.Weight = xlThin
End With
With .Borders(xlEdgeBottom)
.LineStyle = xlContinuous
.ColorIndex = 0
.TintAndShade = 0
.Weight = xlThin
End With
With .Borders(xlEdgeRight)
.LineStyle = xlContinuous
.ColorIndex = 0
.TintAndShade = 0
.Weight = xlThin
End With
With .Borders(xlInsideVertical)
.LineStyle = xlContinuous
.ColorIndex = 0
.TintAndShade = 0
.Weight = xlThin
End With
With .Borders(xlInsideHorizontal)
.LineStyle = xlContinuous
.ColorIndex = 0
.TintAndShade = 0
.Weight = xlThin
End With
End With
End Sub