Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default VBA coding a nested Vlookup, and a sumif formula

I need help.

I have this formula:

=IF(ISERROR(VLOOKUP(IF(C3="",VLOOKUP(D3,Data!B:O,F 3+2,0),IF(D3="",VLOOKUP(C3,Data!B:O,F3+2,0))),$O$3 :$O$114,1,0)),H3&"C0MISCELLANEOUS",H3&(VLOOKUP(IF( C3="",VLOOKUP(D3,Data!B:O,F3+2,0),IF(D3="",VLOOKUP (C3,Data!B:O,F3+2,0))),$O$3:$O$114,1,0)))

And I tried using this code to run instead of the formula above because the
formula takes about 10 minute to run for worksheets, but it gives me #Value!
at row 100.

Sub Run_Data()
Dim iLastRow As Long
Dim i As Long

With Sheets("FBL3N_1")
iLastRow = .Cells(.Rows.Count, "F").End(xlUp).Row
For i = 3 To iLastRow 'iLastRow to 1 Step -1
.Cells(i, "K").Formula = Evaluate("=IF(ISERROR(VLOOKUP(IF(C" & i
& "="""",VLOOKUP(" & _
"D" & i & ",Data!B:O,F3+2,0),IF(D" & i & "="""",VLOOKUP(" &
"C" & i & ",Data!B:O,F3+2,0))),$O$3:$O$114,1,0)),H" & i & "&
""C0MISCELLANEOUS"",H" & i & _
"&(VLOOKUP(IF(C" & i & "="""",VLOOKUP(D" & i &
",Data!B:O,F3+2,0),IF(" & "D" & i & "="""",VLOOKUP(C" & i &
",Data!B:O,F3+2,0))),$O$3:$O$114,1,0)))")
Next i
End With
End Sub


And how would I write a VBA Code to run from F7 to DN71 for the formula below:
I dont want the formulas in the cell. I just want values. Formulas take too
long.

=SUMIF(LZL3N_1!$K$3:$K$43691,Summary!$A7&Summary!F $1,LZL3N_1!$I$3:$I$43691)+SUMIF(LZL3N_2!$K$3:$K$65 536,Summary!$A7&Summary!F$1,LZL3N_2!$I$3:$I$65536)

Thanks,
Xrull

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,420
Default VBA coding a nested Vlookup, and a sumif formula

You don't deserve help mate.

--
__________________________________
HTH

Bob

"Xrull" wrote in message
...
I need help.

I have this formula:

=IF(ISERROR(VLOOKUP(IF(C3="",VLOOKUP(D3,Data!B:O,F 3+2,0),IF(D3="",VLOOKUP(C3,Data!B:O,F3+2,0))),$O$3 :$O$114,1,0)),H3&"C0MISCELLANEOUS",H3&(VLOOKUP(IF( C3="",VLOOKUP(D3,Data!B:O,F3+2,0),IF(D3="",VLOOKUP (C3,Data!B:O,F3+2,0))),$O$3:$O$114,1,0)))

And I tried using this code to run instead of the formula above because
the
formula takes about 10 minute to run for worksheets, but it gives me
#Value!
at row 100.

Sub Run_Data()
Dim iLastRow As Long
Dim i As Long

With Sheets("FBL3N_1")
iLastRow = .Cells(.Rows.Count, "F").End(xlUp).Row
For i = 3 To iLastRow 'iLastRow to 1 Step -1
.Cells(i, "K").Formula = Evaluate("=IF(ISERROR(VLOOKUP(IF(C" &
i
& "="""",VLOOKUP(" & _
"D" & i & ",Data!B:O,F3+2,0),IF(D" & i & "="""",VLOOKUP(" &
"C" & i & ",Data!B:O,F3+2,0))),$O$3:$O$114,1,0)),H" & i & "&
""C0MISCELLANEOUS"",H" & i & _
"&(VLOOKUP(IF(C" & i & "="""",VLOOKUP(D" & i &
",Data!B:O,F3+2,0),IF(" & "D" & i & "="""",VLOOKUP(C" & i &
",Data!B:O,F3+2,0))),$O$3:$O$114,1,0)))")
Next i
End With
End Sub


And how would I write a VBA Code to run from F7 to DN71 for the formula
below:
I don't want the formulas in the cell. I just want values. Formulas take
too
long.

=SUMIF(LZL3N_1!$K$3:$K$43691,Summary!$A7&Summary!F $1,LZL3N_1!$I$3:$I$43691)+SUMIF(LZL3N_2!$K$3:$K$65 536,Summary!$A7&Summary!F$1,LZL3N_2!$I$3:$I$65536)

Thanks,
Xrull



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
SumIf and vlookup formula help Nikki Excel Worksheet Functions 2 June 4th 10 10:31 AM
SUMIF with VLOOKUP nested murkaboris Excel Discussion (Misc queries) 4 April 11th 09 02:01 AM
SUMIF nested Formula Lugar Excel Discussion (Misc queries) 1 November 17th 06 06:59 PM
How do I set up a nested SUMIF formula for a number of variables? Nancy Excel Worksheet Functions 2 January 5th 06 05:57 PM
Do I need a sumif or sum of a vlookup formula? PeterB Excel Worksheet Functions 0 June 1st 05 12:23 PM


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