LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #12   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3,872
Default Complex formula help , please.

Hi Colin,

Am Wed, 2 May 2012 22:22:00 +0100 schrieb Colin Hayes:

Well I'm experimenting with both. The macro causes a long pause while it
processes. The formula works too. Both very good. I could probably build
the formula into a macro too so it's all good.


this macro should be faster. There are no nested for each..next
Please test it in a copy of your workbook:
Sub Checking()
Dim LRow1 As Long
Dim LRow2 As Long
Dim rngC As Range
Dim myFind As Long

With Sheets("Sheet2")
LRow1 = .Cells(.Rows.Count, 2).End(xlUp).Row
LRow2 = Sheets("Sheet1").Cells(Rows.Count, 1).End(xlUp).Row
For Each rngC In Sheets("Sheet1").Range("A2:A" & LRow2)
If WorksheetFunction.CountIf(.Range("B1:B" & LRow2), rngC) 0 Then
myFind = WorksheetFunction.Match(rngC, .Range("B1:B" & LRow1), 0)
If .Cells(myFind, "H") = 3 Or _
.Cells(myFind, "H") .Cells(myFind, "J") Then
rngC.Offset(0, 4) = .Cells(myFind, "J")
End If
End If
Next rngC
End With
End Sub


Regards
Claus Busch
--
Win XP PRof SP2 / Vista Ultimate SP2
Office 2003 SP2 /2007 Ultimate SP2
 
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
Complex IF formula Evan Excel Worksheet Functions 5 September 3rd 12 07:56 AM
complex formula RENEE Excel Programming 6 April 29th 10 12:09 AM
complex color fill conditions- if statements or complex formula? lilly8008 Excel Discussion (Misc queries) 1 December 18th 09 04:57 AM
need complex if formula (I think) b4nature Excel Worksheet Functions 3 June 26th 09 03:19 PM
Need Help with complex formula TJF Excel Worksheet Functions 2 November 25th 05 10:04 PM


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

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

About Us

"It's about Microsoft Excel"