Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 14
Default Fill down VLOOKUP

Hello,
I want to see if its possible to fill down my VLOOKUP
formula, which I created in my macro. This is part of the
macro:
Range("B2").Select
ActiveCell.FormulaR1C1 = "=VLOOKUP(C[1],Sheet1!RC[-1]:R
[155]C,2,0)"

My file will vary in rows so if I do in my macro a range
example, B2:B40 as an autofill, it will put #NA error
because there is no data. So is there a way to copy my
vlookup and not get an error. As I said my file might be
over 50 rows or less than that.

Please advise any help.
thanks,
Juan


  #2   Report Post  
Posted to microsoft.public.excel.programming
No Name
 
Posts: n/a
Default Fill down VLOOKUP

Change your formula to "=IF(ISERROR(VLOOKUP(C[1],Sheet1!RC
[-1]:R[155]C,2,0),"",VLOOKUP(C[1],Sheet1!RC[-1]:R[155]
C,2,0))" and you won't get any error messages when you
autofill down.


-----Original Message-----
Hello,
I want to see if its possible to fill down my VLOOKUP
formula, which I created in my macro. This is part of the
macro:
Range("B2").Select
ActiveCell.FormulaR1C1 = "=VLOOKUP(C[1],Sheet1!RC[-1]:R
[155]C,2,0)"

My file will vary in rows so if I do in my macro a range
example, B2:B40 as an autofill, it will put #NA error
because there is no data. So is there a way to copy my
vlookup and not get an error. As I said my file might be
over 50 rows or less than that.

Please advise any help.
thanks,
Juan


.

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 14
Default Fill down VLOOKUP

Hello,
Here's what I have:
Range("B2").Select
ActiveCell.FormulaR1C1 = "=IF(ISERROR(VLOOKUP(C
[1],Sheet1!RC"[-1]:R[155]C,2,0),"",VLOOKUP(C[1],Sheet1!RC[-
1]:R[155]C,2,0))"
End If
But get an error saying Compile error Expected end of
statement.

Please advise any info.
thanks,
juan
-----Original Message-----
Change your formula to "=IF(ISERROR(VLOOKUP(C[1],Sheet1!RC
[-1]:R[155]C,2,0),"",VLOOKUP(C[1],Sheet1!RC[-1]:R[155]
C,2,0))" and you won't get any error messages when you
autofill down.


-----Original Message-----
Hello,
I want to see if its possible to fill down my VLOOKUP
formula, which I created in my macro. This is part of

the
macro:
Range("B2").Select
ActiveCell.FormulaR1C1 = "=VLOOKUP(C[1],Sheet1!RC[-1]:R
[155]C,2,0)"

My file will vary in rows so if I do in my macro a range
example, B2:B40 as an autofill, it will put #NA error
because there is no data. So is there a way to copy my
vlookup and not get an error. As I said my file might be
over 50 rows or less than that.

Please advise any help.
thanks,
Juan


.

.

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 14
Default Fill down VLOOKUP

Hello,
I figured it out what was wrong. So thank you for the help.

JUAN
-----Original Message-----
Hello,
Here's what I have:
Range("B2").Select
ActiveCell.FormulaR1C1 = "=IF(ISERROR(VLOOKUP(C
[1],Sheet1!RC"[-1]:R[155]C,2,0),"",VLOOKUP(C[1],Sheet1!RC

[-
1]:R[155]C,2,0))"
End If
But get an error saying Compile error Expected end of
statement.

Please advise any info.
thanks,
juan
-----Original Message-----
Change your formula to "=IF(ISERROR(VLOOKUP(C[1],Sheet1!

RC
[-1]:R[155]C,2,0),"",VLOOKUP(C[1],Sheet1!RC[-1]:R[155]
C,2,0))" and you won't get any error messages when you
autofill down.


-----Original Message-----
Hello,
I want to see if its possible to fill down my VLOOKUP
formula, which I created in my macro. This is part of

the
macro:
Range("B2").Select
ActiveCell.FormulaR1C1 = "=VLOOKUP(C[1],Sheet1!RC[-1]:R
[155]C,2,0)"

My file will vary in rows so if I do in my macro a

range
example, B2:B40 as an autofill, it will put #NA error
because there is no data. So is there a way to copy my
vlookup and not get an error. As I said my file might

be
over 50 rows or less than that.

Please advise any help.
thanks,
Juan


.

.

.

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 391
Default Fill down VLOOKUP

You can enter the formula without using the FillDown
method...

example

FirstRow = 20
LastRow = 70
WhichCol = "K"

myformula ="=IF(ISERROR(VLOOKUP(C[1],Sheet1!RC"[-1]: _
R[155]C,2,0),"",VLOOKUP(C[1], _
Sheet1!RC[-1]:R[155]C,2,0))"

With Range(Cells(Firstrow,WhichCol), _
Cells(Lastrow,WhichCol))

.Formular1C1 = myformula

End With


Patrick Molloy
Microsoft Excel MVP



-----Original Message-----
Hello,
I want to see if its possible to fill down my VLOOKUP
formula, which I created in my macro. This is part of

the
macro:
Range("B2").Select
ActiveCell.FormulaR1C1 = "=VLOOKUP(C[1],Sheet1!RC[-1]:R
[155]C,2,0)"

My file will vary in rows so if I do in my macro a range
example, B2:B40 as an autofill, it will put #NA error
because there is no data. So is there a way to copy my
vlookup and not get an error. As I said my file might be
over 50 rows or less than that.

Please advise any help.
thanks,
Juan


.

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
VLOOKUP Auto fill problem Dylan @ UAFC[_2_] Excel Worksheet Functions 2 December 11th 08 10:36 PM
VLOOKUP and Auto Fill problesm Dylan @ UAFC[_2_] Excel Worksheet Functions 1 December 9th 08 02:49 PM
VLOOKUP / Auto Fill / IF? Luke22 Excel Discussion (Misc queries) 4 September 24th 08 07:52 AM
vlookup query after using fill davemel Excel Discussion (Misc queries) 1 August 23rd 06 10:18 AM
Fill down error for Vlookup MC Excel Worksheet Functions 2 June 20th 05 05:22 AM


All times are GMT +1. The time now is 04:24 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"