Hi,

Something like:

 

If Not IsErr(Range("found")) Then
  Range("H2:H5").Value = found
  Else: Range("H2:H5").ClearContents
End If

 

Regards - Dave.



 
> Date: Tue, 23 Mar 2010 07:21:21 -0700
> Subject: Re: $$Excel-Macros$$ VBA VLookup dates
> From: andyr...@hotmail.co.uk
> To: excel-macros@googlegroups.com
> 
> Managed to get a bit further. The Lookup part is working perfectly but
> I can't figure out how to turn the #N/A entries into blanks...
> 
> 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("G2:G5")
> Set rng = Sheets("Front page").Range("fortnight")
> col = 3
> 
> found = Application.vlookup(lookFor.Value, rng, col, 0)
> 
> Range("H2:H5").Value = found
> 
> 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.
                                          
_________________________________________________________________
Browse profiles for FREE! Meet local singles online.
http://clk.atdmt.com/NMN/go/150855801/direct/01/

-- 
----------------------------------------------------------------------------------
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.

Reply via email to