Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default Formula Help within Code

Hello
I am using the following to insert a formula in a cell...

Range("k13").Formula = "=SUMPRODUCT(--($d$14:$d$500=""7-F""),--($J
$14:$J$500=""A""),--($i$14:$i$500<""""),--(ISERROR(MATCH($c$14:$c
$500,MyFile.xlsm'!Data,0))),roundup(1.02*(k$14:k$5 00),0))"

Where Data is a named range with MyFile.xlsm, and the macro resides in
same. The problem is that the file is renamed occasionally and then
the reference in the formula is not correct. I am already using
Dim basebook As Workbook
Set basebook = ThisWorkbook

In the code and I believe that using basebook would remedy the
problem. Hoever I am not sure how to apply Basebook to my formula.

Thanks in advance
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
Formula in Vba code help Charles Excel Programming 2 January 19th 10 05:36 PM
code for a formula hoysala Excel Programming 2 June 28th 08 08:28 AM
Formula to VB Code icetrey[_4_] Excel Programming 3 July 26th 06 08:34 AM
Help with Formula in Code JMB Excel Programming 0 March 26th 06 11:48 PM
Add formula in the code Annette[_5_] Excel Programming 3 February 21st 05 08:19 PM


All times are GMT +1. The time now is 07:51 PM.

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"