Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 47
Default IF INDEX MATCH formula inside VBA with variables

I have alot of help with parts of this, but onto another brick wall...

I need for the index section of the formula to go to the next column
and repeat the process...
1st.....IF(INDEX(MAPActive!C:C & icol &......,
2nd......IF(INDEX(MAPActive!D:D & icol &......, etc...
Or something like this.
So far I have tried numerous combinations and either get #Name? or
nothing at all...

This is one of those times when you change someting it creates another
set of changes



Windows("MAPReport.xls").Activate
Dim LastRow As Long
Dim lastcol As Long
Dim LastRow1 As Long
Dim Lastcol1 As Long
iWkbk = iWkbk + 1
iCol = iCol + 1
Set wbResults = Workbooks.Open(wsFiles.Range("M" &
iWkbk).Value).Worksheets(1)
Set wbResults = Workbooks.Open(wsFiles.Range("MapActive C:C" &
iCol).Value).Worksheets(1)
With Worksheets("MAP")
lastcol = .Cells(40, Columns.Count).End(xlToLeft)(1, 2).Column
LastRow = .Cells(.Rows.Count, "A").End(xlUp).Row
Lastcol1 = .Cells(2, Columns.Count).End(xlToLeft)(1, 2).Column
LastRow1 = .Cells(.Rows.Count, "A").End(xlUp).Row
With .Range(.Cells(40, lastcol), .Cells(LastRow, lastcol))
.Formula = "=IF(INDEX(MAPActive!C:C " & iCol &
",MATCH(MAP!D40,MAPActive!A:A,0))="""",IF(ISERROR( SUMPRODUCT((m" &
iWkbk & ".htm!$A$1:$A$10000=$D40)*(m" & iWkbk &
".htm!$E$1:$E$10000=""Yes"")/(MAP!F$1))),"""",SUMPRODUCT((m" & iWkbk &
".htm!$A$1:$A$10000=$D40)*(m" & iWkbk &
".htm!$E$1:$E$10000=""Yes"")/(MAP!F$1)))"

.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
INDEX - MATCH with three variables Pops Jackson Excel Worksheet Functions 3 July 20th 07 06:09 PM
variables inside a formula?? zerosleep Excel Programming 2 March 1st 06 03:33 PM
Index Match function for multiple linked variables Bob Excel Worksheet Functions 13 November 23rd 05 12:56 AM
Index Match function for multiple linked variables Bob Excel Worksheet Functions 0 November 22nd 05 02:12 AM
Index Match With 3 Variables Scooterdog Excel Worksheet Functions 5 January 2nd 05 07:05 PM


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