magpie2000k
Board Regular
- Joined
- Sep 13, 2013
- Messages
- 196
I have a code written by Fluff
I have been asked to add something to it..
Basically I have it pulling accross the course names. If I have a list of course names saved on say sheet (course names).
I have column a course name on data tab and in column B the revised course name.
can I have it update the course name in the results with new course name
Here is the origonal code
Thanks in advance
I have been asked to add something to it..
Basically I have it pulling accross the course names. If I have a list of course names saved on say sheet (course names).
I have column a course name on data tab and in column B the revised course name.
can I have it update the course name in the results with new course name
Here is the origonal code
Code:
Sub ReorganiseData()
Dim r As Long, c As Long, i As Long, j As Long, k As Long
Dim ary As Variant
Dim Nary() As Variant
ary = Sheets("data").Range("A1").CurrentRegion.Offset(1)
j = 1
For r = 1 To UBound(ary)
For c = 3 To UBound(ary, 2) Step 5
If Not ary(r, c + 1) = "-" Then
ReDim Preserve Nary(1 To 7, 1 To j)
Nary(1, j) = ary(r, 1)
Nary(2, j) = ary(r, 2)
For i = 3 To 7
Nary(i, j) = ary(r, c + k)
k = k + 1
Next i
j = j + 1: k = 0
End If
Next c
Next r
Sheets("Result").Range("A1:G1").Value = Array("Student", "Office", "Course", "Date Assigned", "Attepmts", "Pass Mark", "Date Achieved")
Sheets("Result").Range("A2").Resize(j - 1, 7).Value = Application.Transpose(Nary)
End Sub
Thanks in advance