Reputation: 71
I need a VBA macro that adds the values in column "Unclassified" into "Corporate."
I cannot do this with a Formula because I must delete the column Unclassified completely afterwards.
For example:
Will turn into:
Upvotes: 0
Views: 1494
Reputation: 63
let me know if this works
Sub CorporateAdd()
Application.ScreenUpdating = False
Dim TotalRows As Long
Dim UnclassArray As Variant, CorporateArray As Variant
TotalRows = Range("L1048576").End(xlUp).Row
UnclassArray = Columns("N")
CorporateArray = Columns("L")
For i = 4 To TotalRows
CorporateArray(i, 1) = CorporateArray(i, 1) + UnclassArray(i, 1)
Next i
Columns("L") = CorporateArray
'Uncomment this if you want it to automatically delete "Unclassified"
'Columns("N").Delete Shift:=xlLeft
Application.ScreenUpdating = True
End Sub
But for future reference, I don't think people like when you ask for code, try it out yourself first and if it doesn't work come here for help on fixing it! :)
Upvotes: 3