morbenforsen
New Member
- Joined
- Jul 4, 2015
- Messages
- 20
Hello, I'm trying to use VBA to replace numerous formulas. I am hoping someone might be able to help me with a quick and clean way to do the following based on my example:
I want to;
-search current worksheet in range (column c starting at c3:c13)
-if 'NO' found then mark 'NO' in cell on same row in column D and continue searching down the range in col C.
-if 'YES' found, then search ('some_other_column' in 'a_different_worksheet) for value found in column b (on this worksheet) on the same row. (in example below $37.50)
-if this value ($37.50 or whatever) is found in the different worksheet, then mark 'YES' in cell on same row in column D of THIS worksheet.
-if this value is NOT found in the other worksheet, then mark 'NO' in cell on same row in column D of THIS worksheet.
I hope I am explaining this clearly. Please go easy because while i have a small amount of experience with VBA it has been several years since I have visited this. Any help is most graciously appreciated
<tbody>
[TD="class: xl65"]1[/TD]
[TD="class: xl65"]a[/TD]
[TD="class: xl65"]b[/TD]
[TD="class: xl65"]c[/TD]
[TD="class: xl65, width: 61"]d[/TD]
[TD="class: xl65"]2[/TD]
[TD="class: xl65"]Entity[/TD]
[TD="class: xl65"] cost[/TD]
[TD="class: xl65, width: 40"] Paid[/TD]
[TD="class: xl65, width: 61"] Cleared[/TD]
[TD="class: xl66"]3[/TD]
[TD="class: xl66"]bucket 1[/TD]
[TD="class: xl67, align: right"]$269.00[/TD]
[TD="class: xl66"] No[/TD]
[TD="class: xl66"] No[/TD]
[TD="class: xl66"]4[/TD]
[TD="class: xl66"]bucket 2[/TD]
[TD="class: xl67, align: right"]$37.50[/TD]
[TD="class: xl66"] Yes[/TD]
[TD="class: xl66"] Yes[/TD]
[TD="class: xl66"]5[/TD]
[TD="class: xl66"]bucket 3[/TD]
[TD="class: xl67, align: right"]$100.06[/TD]
[TD="class: xl66"] Yes[/TD]
[TD="class: xl66"] No[/TD]
[TD="class: xl66"]6[/TD]
[TD="class: xl66"]bucket 4[/TD]
[TD="class: xl67, align: right"]$51.71[/TD]
[TD="class: xl66"] Yes[/TD]
[TD="class: xl66"][/TD]
[TD="class: xl66"]7[/TD]
[TD="class: xl66"]bucket 5[/TD]
[TD="class: xl67, align: right"]$167.19[/TD]
[TD="class: xl66"] Yes[/TD]
[TD="class: xl66"][/TD]
[TD="class: xl66"]8[/TD]
[TD="class: xl66"]bucket 6[/TD]
[TD="class: xl67, align: right"]$180.00[/TD]
[TD="class: xl66"] Yes[/TD]
[TD="class: xl66"][/TD]
[TD="class: xl66"]9[/TD]
[TD="class: xl66"]bucket 7[/TD]
[TD="class: xl67, align: right"]$53.75[/TD]
[TD="class: xl66"] Yes[/TD]
[TD="class: xl66"][/TD]
[TD="class: xl66"]10[/TD]
[TD="class: xl66"]bucket 8[/TD]
[TD="class: xl67, align: right"]$266.00[/TD]
[TD="class: xl66"] Yes[/TD]
[TD="class: xl66"][/TD]
[TD="class: xl66"]11[/TD]
[TD="class: xl66"]bucket 9[/TD]
[TD="class: xl67, align: right"]$106.00[/TD]
[TD="class: xl66"] Yes[/TD]
[TD="class: xl66"][/TD]
[TD="class: xl66"]12[/TD]
[TD="class: xl66"]bucket 10[/TD]
[TD="class: xl67, align: right"]$212.34[/TD]
[TD="class: xl66"] Yes[/TD]
[TD="class: xl66"][/TD]
[TD="class: xl66"]13[/TD]
[TD="class: xl66"]bucket 11[/TD]
[TD="class: xl67, align: right"]$19.95[/TD]
[TD="class: xl66"] Yes[/TD]
[TD="class: xl66"][/TD]
</tbody>
I want to;
-search current worksheet in range (column c starting at c3:c13)
-if 'NO' found then mark 'NO' in cell on same row in column D and continue searching down the range in col C.
-if 'YES' found, then search ('some_other_column' in 'a_different_worksheet) for value found in column b (on this worksheet) on the same row. (in example below $37.50)
-if this value ($37.50 or whatever) is found in the different worksheet, then mark 'YES' in cell on same row in column D of THIS worksheet.
-if this value is NOT found in the other worksheet, then mark 'NO' in cell on same row in column D of THIS worksheet.
I hope I am explaining this clearly. Please go easy because while i have a small amount of experience with VBA it has been several years since I have visited this. Any help is most graciously appreciated
<tbody>
[TD="class: xl65"]1[/TD]
[TD="class: xl65"]a[/TD]
[TD="class: xl65"]b[/TD]
[TD="class: xl65"]c[/TD]
[TD="class: xl65, width: 61"]d[/TD]
[TD="class: xl65"]2[/TD]
[TD="class: xl65"]Entity[/TD]
[TD="class: xl65"] cost[/TD]
[TD="class: xl65, width: 40"] Paid[/TD]
[TD="class: xl65, width: 61"] Cleared[/TD]
[TD="class: xl66"]3[/TD]
[TD="class: xl66"]bucket 1[/TD]
[TD="class: xl67, align: right"]$269.00[/TD]
[TD="class: xl66"] No[/TD]
[TD="class: xl66"] No[/TD]
[TD="class: xl66"]4[/TD]
[TD="class: xl66"]bucket 2[/TD]
[TD="class: xl67, align: right"]$37.50[/TD]
[TD="class: xl66"] Yes[/TD]
[TD="class: xl66"] Yes[/TD]
[TD="class: xl66"]5[/TD]
[TD="class: xl66"]bucket 3[/TD]
[TD="class: xl67, align: right"]$100.06[/TD]
[TD="class: xl66"] Yes[/TD]
[TD="class: xl66"] No[/TD]
[TD="class: xl66"]6[/TD]
[TD="class: xl66"]bucket 4[/TD]
[TD="class: xl67, align: right"]$51.71[/TD]
[TD="class: xl66"] Yes[/TD]
[TD="class: xl66"][/TD]
[TD="class: xl66"]7[/TD]
[TD="class: xl66"]bucket 5[/TD]
[TD="class: xl67, align: right"]$167.19[/TD]
[TD="class: xl66"] Yes[/TD]
[TD="class: xl66"][/TD]
[TD="class: xl66"]8[/TD]
[TD="class: xl66"]bucket 6[/TD]
[TD="class: xl67, align: right"]$180.00[/TD]
[TD="class: xl66"] Yes[/TD]
[TD="class: xl66"][/TD]
[TD="class: xl66"]9[/TD]
[TD="class: xl66"]bucket 7[/TD]
[TD="class: xl67, align: right"]$53.75[/TD]
[TD="class: xl66"] Yes[/TD]
[TD="class: xl66"][/TD]
[TD="class: xl66"]10[/TD]
[TD="class: xl66"]bucket 8[/TD]
[TD="class: xl67, align: right"]$266.00[/TD]
[TD="class: xl66"] Yes[/TD]
[TD="class: xl66"][/TD]
[TD="class: xl66"]11[/TD]
[TD="class: xl66"]bucket 9[/TD]
[TD="class: xl67, align: right"]$106.00[/TD]
[TD="class: xl66"] Yes[/TD]
[TD="class: xl66"][/TD]
[TD="class: xl66"]12[/TD]
[TD="class: xl66"]bucket 10[/TD]
[TD="class: xl67, align: right"]$212.34[/TD]
[TD="class: xl66"] Yes[/TD]
[TD="class: xl66"][/TD]
[TD="class: xl66"]13[/TD]
[TD="class: xl66"]bucket 11[/TD]
[TD="class: xl67, align: right"]$19.95[/TD]
[TD="class: xl66"] Yes[/TD]
[TD="class: xl66"][/TD]
</tbody>