Sub DINSA_Mo_Report()
'
' DINSA_Mo_Report Macro
'
'Dim BK As Integer
'Dim wks As Worksheet
Dim toprow As Variant, finalrow As Variant, sdatecol As Variant, edatecol As Variant
toprow = 2
Sheets("Report").Activate
sdatecol = Worksheets("Report").Application.match("Start Date", Range("1:1"), 0)
edatecol = Worksheets("Report").Application.match("End Date", Range("1:1"), 0)
'finalrow = Worksheets("Main").Cells(Rows.Count, 1).End(xlUp).Row
sdate = Worksheets("Report").Cells(2, sdatecol)
EDate = Worksheets("Report").Cells(2, edatecol)
Dim Invordcol As Variant, Suppliercol As Variant, Invsdatecol As Variant, Invnumcol As Variant, Invamtcol As Variant, Invshipcol As Variant, typecol As Variant, repordcol As Variant
finalrow = Worksheets("Main").Cells(Rows.Count, 1).End(xlUp).Row
Sheets("Main").Activate
Suppliercol = Worksheets("Main").Application.match("Supplier", Range("1:1"), 0)
Invsdatecol = Worksheets("Main").Application.match("Invoice Date", Range("1:1"), 0)
Invnumcol = Worksheets("Main").Application.match("Invoice #", Range("1:1"), 0)
Invamtcol = Worksheets("Main").Application.match("Inv. Amt.", Range("1:1"), 0)
Invshipcol = Worksheets("Main").Application.match("Shipping", Range("1:1"), 0)
Sheets("Report").Activate
typecol = Worksheets("Report").Application.match("TYPE", Range("1:1"), 0)
repordcol = Worksheets("Report").Application.match("Order #", Range("1:1"), 0)
Invordcol = Worksheets("Report").Application.match("Order #", Range("1:1"), 0)
'For counter = Worksheets("Main").finalrow To 2 Step -1
'Is invoice date in range of the report we're doing?
If Worksheets("Main").Cells(finalrow, Invsdatecol) >= sdate And Worksheets("Main").Cells(finalrow, Invsdatecol) <= EDate Then
'Worksheets("Report").Cells(toprow, Invordcol) = Worksheets("Main").Cells(finalrow, repordcol)
Worksheets("Report").Cells(toprow, Invordcol) = "'" & Worksheets("Main").Cells(finalrow, repordcol).Text
'next counter
End If
'Next counter
'
End Sub