Rowland Hamilton
Active Member
- Joined
- Nov 13, 2009
- Messages
- 250
The 2nd else does not attach to the first if, and the Next does not attach to the For Each. How do I correct this? - Thanks, Rowland
Code:
For Each Cell In acct
If Left(Cell, 2) = "43" Then 'change from Left(Cell, 3) = "400"
Cell.Font.Bold = True
IO = Left(Cell, 9) 'change from IO = Right(Left(Cell, 9), 6) '(removed 400 front old acct#)
LE = Cell.Offset(0, 1) 'SAP Budget number
Cost = Cell.Offset(0, 4) 'SAP Total=Actuals+Commtmts
'find internal order on template; set Total range on find, _
then move to correct Actuals column
Mktg.Activate 'Activates "Report" sheet
Set Total = code.Find(IO, LookIn:=xlValues)
ElseIf Not Total Is Nothing Then
Set Total = Total.Offset(0, 2) 'Identifies Actuals destination
Set Budget = Total.Offset(0, 2) 'identifies Budget destination
Total.Value = Cost 'Populates Actuals (with Total)
Budget.Value = LE 'Populates Budget
Else: MsgBox "Missing acct Number " & IO
Else: End If
CR.Activate 'Activates "SAP Snapshot" sheet
Next