Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 47
Default Variable inside a formula

All,

Tom Ogilvy has helped me on part of this, but one thing always leads to
another...
The sumproduct section works perfect, thanks Tom!

But, I took his idea and applied it to the IF(Index(match) section and
I cannot get it to work. It returns the #Name?

The IF(index(match) section needs to move incrementally across the
columns of the CMAPActive sheet...The formula works but cannot get it
to move for this section.

Below is what I have at this point...

I have called num at the beginning of the code As Variant

Windows("CMAP.xls").Activate
Dim LastRow As Long
Dim lastcol As Long
iWkbk = iWkbk + 1
num = 1
num = num + 1

Set wbResults = Workbooks.Open(wsFiles.Range("C" &
iWkbk).Value).Worksheets(1)
With Worksheets("CMAP")
lastcol = .Cells(40, Columns.Count).End(xlToLeft)(1, 2).Column
LastRow = .Cells(.Rows.Count, "A").End(xlUp).Row
With .Range(.Cells(40, lastcol), .Cells(LastRow, lastcol))
.Formula = "=IF(INDEX(CMAPActive! C:C" & num &
",MATCH($C40,CMAPActive!$A:$A,0))="""",IF(ISERROR( SUMPRODUCT((c" &
iWkbk & ".htm!$A$1:$A$10000=$C40)*(c" & iWkbk &
".htm!$E$1:$E$10000=""Yes"")/(CMAP!F$39))),"""",SUMPRODUCT((c" & iWkbk
& ".htm!$A$1:$A$10000=$C40)*(c" & iWkbk &
".htm!$E$1:$E$10000=""Yes"")/(CMAP!F$39))),""Inactive"")"
.Value = .Value


End With
End With



Thanks
Hans

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
Using a range variable inside a excel function Michael Excel Discussion (Misc queries) 2 November 14th 05 02:52 PM
Variable with no Value inside Macro Equation?? TEAM Excel Programming 2 June 1st 05 07:13 PM
Average For Variable-length Column (w N/A value inside) Billabong Excel Programming 0 October 4th 04 04:04 AM
Average For Variable-length Column (w N/A value inside) Billabong Excel Programming 1 October 4th 04 03:33 AM
variable inside a formula? Phil Excel Programming 5 July 28th 04 12:04 AM


All times are GMT +1. The time now is 05:09 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"