Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Can't fill XL Formula in VBA

I have the following formula that works fine as long as I manually fil
down on the sheet:

=IF(ISNA(VLOOKUP(A9,$P$8:$Q$94,2,FALSE)),"",VLOOKU P(A9,$P$8:$Q$94,2,FALSE))

When I put the code into VBA it compiles but hangs up when run. Th
VBA code is:

Range("K8").Select
ActiveCell.FormulaR1C1
"=IF(ISNA(VLOOKUP(A9,$P$8:$Q$94,2,FALSE)),"",VLOOK UP(A9,$P$8:$Q$94,2,FALSE))"
Selection.AutoFill Destination:=Range("K8:K153")
Type:=xlFillDefault

I get a "run time error '1004', Application-defined or object-define
error." Hitting debug the editor jumps to my "ActiveCell line abov
suggesting the error is in the formula.

What gives? Any help is appreciated.

Lift Of

--
Message posted from http://www.ExcelForum.com

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Can't fill XL Formula in VBA

See if this cade works?

Range("K8").Select
ActiveCell.FormulaR1C1 = _

"=IF(ISNA(VLOOKUP(R[1]C[-10],R8C16:R94C17,2,FALSE)),"""",VLOOKUP(R[1]C[-10],R8C16:R94C17,2,FALSE))"
Range("K8").Select
Selection.AutoFill Destination:=Range("K8:K153")
Type:=xlFillDefault
Range("K8:K153").Selec

--
Message posted from http://www.ExcelForum.com

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Can't fill XL Formula in VBA

Paul: That did it. I had relative in there at first but changed it t
A1 in the post. I noticed you added the second range select. Why i
it necessary to do that? Just curious. Need to learn.

Thanks again, Lift Of

--
Message posted from http://www.ExcelForum.com

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Can't fill XL Formula in VBA

don't think so! probably just a mistake by me long day :

--
Message posted from http://www.ExcelForum.com

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
Fill Formula please palups Excel Worksheet Functions 5 November 12th 09 08:27 AM
formula fill down Pezcore Excel Discussion (Misc queries) 4 May 10th 08 06:17 PM
Fill Down formula Help Please singlgl1 Excel Discussion (Misc queries) 6 October 24th 05 08:22 PM
Help with formula fill down comotoman Excel Discussion (Misc queries) 4 October 3rd 05 09:46 PM
Using VB to fill a formula down eli silverman Excel Programming 1 October 27th 03 03:52 PM


All times are GMT +1. The time now is 12:03 AM.

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

About Us

"It's about Microsoft Excel"