LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Member
 
Posts: 70
Default VBA "Find" with multiple criterion

I'm trying to do a somewhat complicated find in VBA.

I have a worksheet with column B having only two different values (eg. a and b). Column C has values that repeat for each value for column B. (eg. 1 and 2). The values that I want to return are in columns E and F.

So what I'm trying to do is this:

If columns B and C equal "a" and "1" (respectively), then subtract the values in E and F (on that row where the columns equal) and return that result on another worksheet.

Repeat for all the different combinations...a1, a2, b1, b2.

To illustrate:

Code:
Column B | Column C                Column E | Column F

   a             1                   70            50
   a             2                   80            30
   b             1                   60            20
   b             2                   40            20
I want to find a1 and write "20" in another worksheet.

Sorry if this is an overly long explanation, I feel like it's confusing to explain. Let me know if anything needs to be clarified. As always, any help is appreciated!

EDIT: If formulas can be used for this that'll work too. I can incorporate them into my VBA code. I'm messing with the Index and Match, but I'm not having any luck. I basically need to look up two different values and return two different values (and subtract them). I'm not sure if this is possible in a formula.

Last edited by KeriM : August 14th 12 at 05:01 PM Reason: Adding Information
 
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
"Coult not find specified object" and "Path-File access error" messages Robert Crandal Excel Programming 3 December 19th 09 09:12 PM
Whats wrong with this? MyWBAccRep.Sheets("Volumes").Cells.Find("latest").Copy.Offset(0, Simon[_2_] Excel Programming 2 August 11th 08 01:29 PM
find "Cancellation" in column "A" and copy all data from Columns B-F onto another Sheet bjohnson Excel Programming 1 September 20th 07 04:02 PM
HELP on "left","right","find","len","substitute" functions serene83 Excel Discussion (Misc queries) 5 June 27th 06 02:23 AM


All times are GMT +1. The time now is 03:08 AM.

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"