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

Bring active cell back into view
Start at A1 and select to A9999 while writing a formula, you can't see A1 anymore. Press Ctrl+Backspace to bring active cell into view.
Part of my formula went missing in the previous post.
It should continue:-

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

Eric Hearn
 
Upvote 0
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
 
Upvote 0
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
 
Upvote 0

Forum statistics

Threads
1,214,617
Messages
6,120,541
Members
448,970
Latest member
kennimack

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
Back
Top