Sorting macro is not working

Microsoft Office 2010 professional
October 18, 2012 at 21:13:07
Specs: Windows 7, intel i3/4GB
here i attached the sorting macro i have written for sorting the answers. I have four series question paper i.e. A,B,C and D. please help me out
here is the code
" (Sub sort()

Dim i As Long
Dim j As Long
Dim k As Long
Dim designcolumn As Long
Dim designrow As Long

Dim row As Long
Dim col As Long

For row = 1 To 5
For col = 1 To 63
Sheets("N-SCHOOL-SCI-SORTED").Cells(row, col).Value = Sheets("N-SCHOOL-SCI").Cells(row, col).Value
Next col

Next row

For row = 6 To 100

For col = 1 To 5

Sheets("N-SCHOOL-SCI-SORTED").Cells(row, col).Value = Sheets("N-SCHOOL-SCI").Cells(row, col).Value

Next col
designrow = 5
For col = 6 To 63

If Sheets("N-SCHOOL-SCI-SORTED").Cells(row, 1).Value = "A" Then
designcolumn = 2
ElseIf Sheets("N-SCHOOL-SCI-SORTED").Cells(row, 1).Value = "B" Then
designcolumn = 3
ElseIf Sheets("N-SCHOOL-SCI-SORTED").Cells(row, 1).Value = "C" Then
designcolumn = 4
ElseIf Sheets("N-SCHOOL-SCI-SORTED").Cells(row, 1).Value = "D" Then
designcolumn = 5
End If

Sheets("N-SCHOOL-SCI-SORTED").Cells(row, col).Value = Sheets("N-SCHOOL-SCI").Cells(row, Sheets("N-SCHOOL-SCI-DESIGN").Cells(designrow, designcolumn).Value + 5).Value
designrow = designrow + 1
Next col

Next row
End Sub
)"


See More: Sorting macro is not working

Report •


#1
November 7, 2012 at 03:26:18
What part of this macro is not working?
can you give us some examples of data in your sheets and what the expected outcome should be and what you are actually getting?

Also, before posting code please look at the below link - tutoral written by DerbyDad on how to past code, it makes it easier to read and understand

http://www.computing.net/howtos/sho...


Report •
Related Solutions


Ask Question