Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() 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.Dele te Sheets("Invoice").Columns("e:e").EntireColumn.Dele te End Sub ------------------- -- Metraza ----------------------------------------------------------------------- Metrazal's Profile: http://www.excelforum.com/member.php...fo&userid=3164 View this thread: http://www.excelforum.com/showthread.php?threadid=52057 |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I'd guess that there was some non-numeric stuff in columns D or E.
Metrazal wrote: What am I missing? Getting the above error with this code. I want to subtract the column "e" from "d" put the results in column "f" and 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.Dele te Sheets("Invoice").Columns("e:e").EntireColumn.Dele te End Sub -------------------- -- Metrazal ------------------------------------------------------------------------ Metrazal's Profile: http://www.excelforum.com/member.php...o&userid=31648 View this thread: http://www.excelforum.com/showthread...hreadid=520573 -- Dave Peterson |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
One other word of caution. Once you delete column D, column E becomes
D. Delete E first then D. *** Sent via Developersdex http://www.developersdex.com *** |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Or just get them both at once:
Sheets("Invoice").Columns("d:E").EntireColumn.Dele te Edward Ulle wrote: One other word of caution. Once you delete column D, column E becomes D. Delete E first then D. *** Sent via Developersdex http://www.developersdex.com *** -- Dave Peterson |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() Thats it, stupid me had some text way down my spreadsheet. Thanks, Met -- Metrazal ------------------------------------------------------------------------ Metrazal's Profile: http://www.excelforum.com/member.php...o&userid=31648 View this thread: http://www.excelforum.com/showthread...hreadid=520573 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Visual Basic Error Run Time Error, Type Mismatch | Excel Discussion (Misc queries) | |||
Help: Compile error: type mismatch: array or user defined type expected | Excel Programming | |||
Type Mismatch Error | Excel Programming | |||
Type Mismatch Error | Excel Programming | |||
Befuddled with For Next Loop ------ Run - Time Error '13' Type Mismatch Error | Excel Programming |