Macros replace if arguments

B

Bakar

Hi Everyone
can someone help please
let say I have in Sheet 1 in cells CW 24 =yes,CW 25 =yes,CW 26 =yes,C
27 =yes,CW 28 =yes
If all thes cells are yes I want a macro to give me a message bo
"Successfully completed!"

Thnxs for your valuable help
Baka
 
H

Howard

Hi Everyone

can someone help please

let say I have in Sheet 1 in cells CW 24 =yes,CW 25 =yes,CW 26 =yes,CW

27 =yes,CW 28 =yes

If all thes cells are yes I want a macro to give me a message box

"Successfully completed!"



Thnxs for your valuable help

Bakar

Hi Bakar,
Try this, meanwhile I will try to do it with a macro as you asked.

=IF(COUNTIF(CW24:CW28,"yes")=5,"S-C","")

Regards,
Howard
 
H

Howard

Hi Everyone

can someone help please

let say I have in Sheet 1 in cells CW 24 =yes,CW 25 =yes,CW 26 =yes,CW

27 =yes,CW 28 =yes

If all thes cells are yes I want a macro to give me a message box

"Successfully completed!"



Thnxs for your valuable help

Bakar

Here is a message box code:

Private Sub Worksheet_Change(ByVal Target As Range)
If Application.WorksheetFunction.CountIf(Range("CW24:CW28"), "yes") = 5 Then
MsgBox "Successfully completed!", vbOKOnly, "Get'er Done"
End If
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top