Hello,
This code needs to locate the Department63's account total and transfer it to designated row in another sheet. The problem I am having is the macro not being able to locate Department63's account total which is located between Department 60 and 65. The macro can locate Dept 60 and 65's account total and transfer it but doesn't find account total for Dept63.
Account total is always in ColumnB and the data is always from Column D to H.
This code needs to locate the Department63's account total and transfer it to designated row in another sheet. The problem I am having is the macro not being able to locate Department63's account total which is located between Department 60 and 65. The macro can locate Dept 60 and 65's account total and transfer it but doesn't find account total for Dept63.
Account total is always in ColumnB and the data is always from Column D to H.
Code:
Sub NumberTrans_Dep60()Dim nlast As Long
Dim sht As Worksheet
Dim n As Integer
Sheets("Amanda").Activate
Set sht = ActiveWorkbook.ActiveSheet
nlast = Cells(Rows.Count, "B").End(xlUp).Row
For n = nlast To 1 Step -1
If sht.Cells(n, 1).Value = "Department 60 Adult Program Department" Then
ElseIf sht.Cells(n, 2).Value = "ACCOUNT TOTAL" Then
Range(Cells(n, "D"), Cells(n, "H")).Copy
Sheets("AR SUMMARY").Range("C19").PasteSpecial xlPasteValues
End If
Next n
End Sub
Sub NumberTrans_Dep63()
Dim nlast As Long
Dim sht As Worksheet
Dim n As Integer
Sheets("Amanda").Activate
Set sht = ActiveWorkbook.ActiveSheet
nlast = Cells(Rows.Count, "B").End(xlUp).Row
For n = nlast To 1 Step -1
If sht.Cells(n, 1).Value = "Department 63 Writers'Voice NatlDept" Then
ElseIf sht.Cells(n, 2).Value = "ACCOUNT TOTAL" Then
Range(Cells(n, "D"), Cells(n, "H")).Copy
Sheets("AR SUMMARY").Range("C20").PasteSpecial xlPasteValues
End If
Next n
End Sub
Sub NumberTrans_Dep65()
Dim nlast As Long
Dim sht As Worksheet
Dim n As Integer
Sheets("Amanda").Activate
Set sht = ActiveWorkbook.ActiveSheet
nlast = Cells(Rows.Count, "B").End(xlUp).Row
For n = nlast To 1 Step -1
If sht.Cells(n, 1).Value = "Department 65 Visual and Performing Art" Then
ElseIf sht.Cells(n, 2).Value = "ACCOUNT TOTAL" Then
Range(Cells(n, "D"), Cells(n, "H")).Copy
Sheets("AR SUMMARY").Range("C21").PasteSpecial xlPasteValues
Exit For
End If
Next n
End Sub