Hey all, I'm trying to cut down on loading times by converting a load of formulae to code.
I'm stuck on this particular formula - =IF(ISERROR(VLOOKUP((C3),fortnight,3,FALSE)),"",VLOOKUP((C3),fortnight, 3,FALSE)) The main problem I seem to be having is how to amend the code to properly detect when date fields match. This is what I have so far for the VBA - Private Sub Worksheet_Change(ByVal Target As Range) Dim lookFor As Range Dim rng As Range Dim col As Integer Dim found As Variant Set lookFor = Sheets("Access Data").Range("E2") Set rng = Sheets("Front page").Range("fortnight") col = 3 On Error Resume Next found = Application.vlookup(lookFor.Value, rng, col, 0) If IsError(found) Then MsgBox lookFor & " not found" Else: MsgBox "The look-up value of " & lookFor & " is " & found & " in column " & col End If On Error GoTo 0 End Sub -- ---------------------------------------------------------------------------------- Some important links for excel users: 1. Follow us on TWITTER for tips tricks and links : http://twitter.com/exceldailytip 2. Join our Facebook Group @ http://www.facebook.com/group.php?gid=287779555678 3. Excel tutorials at http://www.excel-macros.blogspot.com 4. Learn VBA Macros at http://www.quickvba.blogspot.com 5. Excel Tips and Tricks at http://exceldailytip.blogspot.com To post to this group, send email to excel-macros@googlegroups.com <><><><><><><><><><><><><><><><><><><><><><> HELP US GROW !! We reach over 6,800 subscribers worldwide and receive many nice notes about the learning and support from the group.Let friends and co-workers know they can subscribe to group at http://groups.google.com/group/excel-macros/subscribe To unsubscribe from this group, send email to excel-macros+unsubscribegooglegroups.com or reply to this email with the words "REMOVE ME" as the subject.