Macro instead of formula

Eric Hearn

New Member
Joined
Mar 17, 2006
Messages
42
I want to use an 'if...then...else' block instead of the following formula:-

=IF(AND(A3="€",COUNT(C1:C10)<COUNT(B1:B10)),"Something","Something Else")

Could somebody supply me with the appropriate code?

T.I.A.

Eric Hearn
 

Excel Facts

Add Bullets to Range
Select range. Press Ctrl+1. On Number tab, choose Custom. Type Alt+7 then space then @ sign (using 7 on numeric keypad)

Eric Hearn

New Member
Joined
Mar 17, 2006
Messages
42
Part of my formula went missing in the previous post.
It should continue:-

(B1:B10)),"Something","Something Else")

Eric Hearn
 

patrickmuldoon99

Active Member
Joined
Jun 27, 2006
Messages
345
Code:
if [a3] = "euro symbol" then
application.worksheetfunction.Count(C1:C10)
end if

You need to insert the euro symbol where it says "euro symbol"

you're formula by the way isn't correct, there should be another condition for the AND to have any effect

HTH
 

Eric Hearn

New Member
Joined
Mar 17, 2006
Messages
42
Hi Guys

Please see my second post above.

Thanks

Eric Hearn
 

fairwinds

MrExcel MVP
Joined
May 15, 2003
Messages
8,638
Hi,

=IF(AND(A3="€",COUNT(C1:C10) < COUNT(B1:B10)),"Something","Something Else")


If Range("A3") = "€" And WorksheetFunction.Count(Range("C1:C10")) < WorksheetFunction.Count(Range("B1:B10")) Then
MsgBox "Something"
Else
MsgBox "Something Else"
End If
 

Forum statistics

Threads
1,171,967
Messages
5,878,534
Members
433,348
Latest member
eramirez148

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top