Type mismatch error

M

Metrazal

What am I missing? Getting the above error with this code. I want t
subtract the column "e" from "d" put the results in column "f" an
delete column "e" & "d".

Thanks,

Met




Code
-------------------

Sub Calculate_Delete()
Worksheets("Invoice").Select
For a = 1 To 1000
Cells(a, "f").Value = Cells(a, "d").Value - Cells(a, "e").Value
Next a
Sheets("Invoice").Columns("d:d").EntireColumn.Delete
Sheets("Invoice").Columns("e:e").EntireColumn.Delete
End Sub
 
E

Edward Ulle

One other word of caution. Once you delete column D, column E becomes
D. Delete E first then D.
 
D

Dave Peterson

Or just get them both at once:

Sheets("Invoice").Columns("d:E").EntireColumn.Delete
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top