Sub Please_Help_Me_Make_This_More_Efficient()
'Dynamic (only works if there is at least one conversion already on the list otherwise it is a type mismatch)
Sheets("Active Stuff").Activate
Range("A1").End(xlDown).Offset(1, 0).EntireRow.Insert
Dim Variable1 As Single
Dim Variable2 As Single
Dim Variable 3 As String
Dim Variable4 As String
Dim Variable5 As String
Dim Variable6 As String
Dim Variable7 As Single
Dim Variable8 As Long
Dim Variable9 As Long
Dim Variable10 As Single
Dim Variable11 As Single
Dim Variable13 As Long
Dim Variable14 As Long
Dim Variable15 As Long
Dim Variable16 As Long
Dim Variable18 As Long
Dim Variable21 As String
Dim Variable22 As Long
Dim Variable24 As Long
Dim Variable25 As Single
Dim Variable28 As Date
Dim a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, v, u
Variable1 = InputBox("Enter Variable1", "Variable1") 'Column A entry
a = Application.Match("Variable1", Rows(2), 0)
lastrow0 = Worksheets("Active Stuff").Cells(2, a).End(xlDown).Offset(1, 0).Select
ActiveCell = Variable1
Variable2 = InputBox("Enter Variable2", "Variable2") 'Column B Entry
b = Application.Match("Variable2", Rows(2), 0)
lastrow1 = Worksheets("Active Stuff").Cells(2, b).End(xlDown).Offset(1, 0).Select
ActiveCell = Variable2
Variable3 = InputBox("Enter Variable3", "Variable3") 'Column C Entry
c = Application.Match("Variable3", Rows(2), 0)
lastrow2 = Worksheets("Active Stuff").Cells(2, c).End(xlDown).Offset(1, 0).Select
ActiveCell = Variable3
Variable4 = InputBox("Enter Variable4", "Variable4") 'Column D Entry
d = Application.Match("Variable4", Rows(2), 0)
lastrow3 = Worksheets("Active Stuff").Cells(2, d).End(xlDown).Offset(1, 0).Select
ActiveCell = Variable4
Variable5 = InputBox("Enter Variable5", "Variable5") 'Column E Entry
e = Application.Match("Variable5", Rows(2), 0)
lastrow4 = Worksheets("Active Stuff").Cells(2, e).End(xlDown).Offset(1, 0).Select
ActiveCell = Variable5
Variable6 = InputBox("Enter Variable6", "Variable6") 'Column F Entry
f = Application.Match("Variable6", Rows(2), 0)
lastrow5 = Worksheets("Active Stuff").Cells(2, f).End(xlDown).Offset(1, 0).Select
ActiveCell = Variable6
Variable7 = InputBox("Enter Variable7", "Variable7") 'Column G Entry
g = Application.Match("Variable7", Rows(2), 0)
lastrow6 = Worksheets("Active Stuff").Cells(2, g).End(xlDown).Offset(1, 0).Select
ActiveCell = Variable7
Variable8 = InputBox("Enter Variable8", "Variable8") 'Column H Entry
h = Application.Match("Variable8", Rows(2), 0)
lastrow7 = Worksheets("Active Stuff").Cells(2, h).End(xlDown).Offset(1, 0).Select
ActiveCell = Variable8
Variable9 = InputBox("Enter Variable9", "Variable9") 'Column I Entry
i = Application.Match("Variable9", Rows(2), 0)
lastrow8 = Worksheets("Active Stuff").Cells(2, i).End(xlDown).Offset(1, 0).Select
ActiveCell = Variable9
Variable10 = InputBox("Enter Variable10", "Variable10") 'Column J Entry
j = Application.Match("Variable10", Rows(2), 0)
lastrow9 = Worksheets("Active Stuff").Cells(2, j).End(xlDown).Offset(1, 0).Select
ActiveCell = Variable10
Variable11 = InputBox("Enter Variable11", "Variable11") 'Column K Entry
k = Application.Match("Variable11", Rows(2), 0)
lastrow10 = Worksheets("Active Stuff").Cells(2, k).End(xlDown).Offset(1, 0).Select
ActiveCell = Variable11
Variable13 = InputBox("Enter Variable13", "Variable13") 'Column M Entry
l = Application.Match("Variable13", Rows(2), 0)
lastrow12 = Worksheets("Active Stuff").Cells(2, l).End(xlDown).Offset(1, 0).Select
ActiveCell = Variable13
Variable14 = InputBox("Enter Variable14", "Variable14") 'Column N Entry
m = Application.Match("Variable14", Rows(2), 0)
lastrow13 = Worksheets("Active Stuff").Cells(2, m).End(xlDown).Offset(1, 0).Select
ActiveCell = Variable14
Variable15 = InputBox("Enter Variable15", "Variable15") 'Column O Entry
n = Application.Match("Variable15", Rows(2), 0)
lastrow14 = Worksheets("Active Stuff").Cells(2, n).End(xlDown).Offset(1, 0).Select
ActiveCell = Variable15
Variable16 = InputBox("Enter Variable16", "Variable16") 'May be able to automate this value with a simple function formula Column P Entry
o = Application.Match("Variable16", Rows(2), 0)
lastrow15 = Worksheets("Active Stuff").Cells(2, o).End(xlDown).Offset(1, 0).Select
ActiveCell = Variable16
Variable18 = InputBox("Enter Variable18", "Variable18") 'Column R Entry
p = Application.Match("Variable18", Rows(2), 0)
lastrow17 = Worksheets("Active Stuff").Cells(2, p).End(xlDown).Offset(1, 0).Select
ActiveCell = Variable18
Variable21 = InputBox("Enter Variable21", "Variable21") 'Column U Entry
q = Application.Match("Variable21", Rows(2), 0)
lastrow20 = Worksheets("Active Stuff").Cells(2, q).End(xlDown).Offset(1, 0).Select
ActiveCell = Variable21
Variable22 = InputBox("Enter Variable22", "Variable22") 'Column V Entry
r = Application.Match("Variable22", Rows(2), 0)
lastrow21 = Worksheets("Active Stuff").Cells(2, r).End(xlDown).Offset(1, 0).Select
ActiveCell = Variable22
Variable24 = InputBox("Enter Variable24", "Variable24") 'Column X Entry
s = Application.Match("Variable24", Rows(2), 0)
lastrow23 = Worksheets("Active Stuff").Cells(2, s).End(xlDown).Offset(1, 0).Select
ActiveCell = Variable24
Variable25 = InputBox("Enter Variable25", "Variable25") 'Column Y Entry
v = Application.Match("Variable25", Rows(2), 0)
lastrow24 = Worksheets("Active Stuff").Cells(2, v).End(xlDown).Offset(1, 0).Select
ActiveCell = Variable25
Variable28 = InputBox("Enter Variable28", "Variable28") 'Column AB Entry
u = Application.Match("Variable28", Rows(2), 0)
lastrow27 = Worksheets("Active Stuff").Cells(2, u).End(xlDown).Offset(1, 0).Select
ActiveCell = Variable28
Dim rngVariable12 As Range
Set rngVariable12= Range("A2:AZ2").Find("Variable12", , xlValues, xlWhole, xlByRows, xlNext, False)
If rngVariable12 Is Nothing Then
MsgBox "Variable12 header was not found."
Exit Sub
End If
Range(rngVariable12, rngVariable12).End(xlDown).Copy
Range(rngVariable12, rngVariable12).End(xlDown).Offset(1, 0).PasteSpecial
Dim rngVariable17 As Range
Set rngVariable17 = Range("A2:AZ2").Find("Variable17", , xlValues, xlWhole, xlByRows, xlNext, False)
If rngVariable17 Is Nothing Then
MsgBox "Variable17 header was not found."
Exit Sub
End If
Range(rngVariable17, rngVariable17).End(xlDown).Copy
Range(rngVariable17, rngVariable17).End(xlDown).Offset(1, 0).PasteSpecial
Dim rngVariable19 As Range
Set rngVariable19 = Range("A2:AZ2").Find("Variable19", , xlValues, xlWhole, xlByRows, xlNext, False)
If rngVariable19 Is Nothing Then
MsgBox "Variable19 header was not found."
Exit Sub
End If
Range(rngVariable19, rngVariable19).End(xlDown).Copy
Range(rngVariable19, rngVariable19).End(xlDown).Offset(1, 0).PasteSpecial
Dim rngVariable20 As Range
Set rngVariable20 = Range("A2:AZ2").Find("Variable20", , xlValues, xlWhole, xlByRows, xlNext, False)
If rngVariable20 Is Nothing Then
MsgBox "Variable20 header was not found."
Exit Sub
End If
Range(rngVariable20, rngVariable20).End(xlDown).Copy
Range(rngVariable20, rngVariable20).End(xlDown).Offset(1, 0).PasteSpecial
Dim rngVariable23 As Range
Set rngVariable23 = Range("A2:AZ2").Find("Variable23", , xlValues, xlWhole, xlByRows, xlNext, False)
If rngVariable23 Is Nothing Then
MsgBox "Variable23 header was not found."
Exit Sub
End If
Range(rngVariable23, rngVariable23).End(xlDown).Copy
Range(rngVariable23, rngVariable23).End(xlDown).Offset(1, 0).PasteSpecial
Dim rngVariable26 As Range
Set rngVariable26 = Range("A2:AZ2").Find("Variable26", , xlValues, xlWhole, xlByRows, xlNext, False)
If rngVariable26 Is Nothing Then
MsgBox "Variable26 header was not found."
Exit Sub
End If
Range(rngVariable26, rngVariable26).End(xlDown).Copy
Range(rngVariable26, rngVariable26).End(xlDown).Offset(1, 0).PasteSpecial
Dim rngVariable27 As Range
Set rngVariable27 = Range("A2:AZ2").Find("Variable27", , xlValues, xlWhole, xlByRows, xlNext, False)
If rngVariable27 Is Nothing Then
MsgBox "Variable27 header was not found."
Exit Sub
End If
Range(rngVariable27, rngVariable27).End(xlDown).Copy
Range(rngVariable27, rngVariable27).End(xlDown).Offset(1, 0).PasteSpecial
Dim rngD As Range
Set rngD = Range("A2:AZ2").Find("Variable1", , xlValues, xlWhole, xlByRows, xlNext, False)
If rngD Is Nothing Then
MsgBox "Variable1 header was not found."
Exit Sub
End If
Dim rngE As Range
Set rngE = Range("A2:AZ2").Find("Variable2", , xlValues, xlWhole, xlByRows, xlNext, False)
If rngE Is Nothing Then
MsgBox "Variable2 header was not found."
Exit Sub
End If
ActiveWorkbook.Worksheets("Active Stuff").Sort.SortFields.Clear
ActiveWorkbook.Worksheets("Active Stuff").Sort.SortFields.Add2 Key _
:=Range(rngD, rngD.End(xlDown)), SortOn:=xlSortOnValues, Order:=xlAscending, _
DataOption:=xlSortNormal
ActiveWorkbook.Worksheets("Active Stuff").Sort.SortFields.Add2 Key _
:=Range(rngE, rngE.End(xlDown)), SortOn:=xlSortOnValues, Order:=xlAscending, _
DataOption:=xlSortNormal
With ActiveWorkbook.Worksheets("Active Stuff").Sort
.SetRange Range("A2:AZ65536")
.Header = xlYes
.MatchCase = False
.Orientation = xlTopToBottom
.SortMethod = xlPinYin
.Apply
End With
End Sub