VBA code for an error

Xrull

Board Regular
Joined
Dec 26, 2008
Messages
73
Good Day to you all,
I'm trying to write a VBA code to place the value of these formulas in the cells.

Code:
=IF(ISERROR(IF(D3="","",I3-F3)),"Re-check",(IF(D3="","",I3-F3)))
or
Code:
=IF(ISERROR(IF(D3<>"",I3-F3,"")),"Re-check",(IF(D3<>"",I3-F3,"")))

These formulas are subtracting dates.
I need it to run the length of Column N.
I tried to write a code, I'm unable to overcome the error a text is placed in the a cell in column L or column I in the but I'm afraid it is not making any sense to me.
Please help,
Xrull
 
jasonb75,
The code is giving me a run time error '13' Type mismatch. I'm not familar with the IFERROR part of the code I use If(iserror(.
I'm working with Excel 2003, and probably you are writing the code for Excel 2007. I
Thanks,
Xrull
 
Upvote 0

Excel Facts

Round to nearest half hour?
Use =MROUND(A2,"0:30") to round to nearest half hour. Use =CEILING(A2,"0:30") to round to next half hour.
Just had the same problem with another guy I've been trying to help out, IFERROR is 07 only, give me 5 to rewrite

Try
Code:
Sub Macro15() 'Invoice date to post date
 With Sheets("Entry")
      For a = 3 To Range("D" & Rows.Count).End(xlUp).Row
      If Range("D" & a) <> "" Then
      Range("M" & a) = "=IF(ISERROR(L" & a & "-I" & a & "),""Re-check"",L" & a & "-I" & a & ")"
      End If
      If Range("M" & a).Value < 0 Then Range("M" & a) = "Re-check"
      Range("M" & a) = Range("M" & a).Value
      Next
      End With
 
End Sub
 
Last edited:
Upvote 0
jasonb75,
It worked. Now I can have a strong drink and get some sleep. I've got to study this code.
Thanks
 
Upvote 0
Haha good luck with the study if you want to try and make any sense of it, maybe a few more of those strong drinks in order first :)
 
Upvote 0

Forum statistics

Threads
1,215,066
Messages
6,122,948
Members
449,095
Latest member
nmaske

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top