Create maro button with two different function

raphagcwill

New Member
Joined
Jan 12, 2016
Messages
41
Hi again,

I have two macros that are based on Condition formating.

They both search for specific text in column N, but dispalys diferents results.

WHen I run the macro, the entirerow where my text "ppo" is turns green. If i have 5 other matchaes , then they are all formatted togheter.

I would like the macro to find the first row wit the text "ppo" and then ask me if I want to apply makro 1 or 2.

The I would like to be asked for all the other matches.

Thanks in advance,
Raphael


Sub NO()
'
' NO Macro
'

'
Application.ScreenUpdating = False

Range("A:N").Select
Selection.FormatConditions.Delete
Selection.FormatConditions.Add Type:=xlExpression, Formula1:="=$N1=""PPO"""
Selection.FormatConditions(Selection.FormatConditions.Count).SetFirstPriority
With Selection.FormatConditions(1).Interior
.PatternColorIndex = xlAutomatic
.Color = 65535
.TintAndShade = 0
End With
With Selection.FormatConditions(1).Font
.Bold = True
.Italic = False
.Strikethrough = True
.Color = -16776961
.TintAndShade = 0
End With
Selection.FormatConditions(1).StopIfTrue = False

Application.ScreenUpdating = True

Range("A2").Select

End Sub






Sub YES()
'
' YES Macro
'

'
Application.ScreenUpdating = False

Range("A:N").Select
Selection.FormatConditions.Delete
Selection.FormatConditions.Add Type:=xlExpression, Formula1:="=$N1=""PPO"""
Selection.FormatConditions(Selection.FormatConditions.Count).SetFirstPriority
With Selection.FormatConditions(1).Interior
.PatternColorIndex = xlAutomatic
.Color = 5296274
.TintAndShade = 0
End With
Selection.FormatConditions(1).StopIfTrue = False

Application.ScreenUpdating = True

Range("A2").Select

End Sub
 

Excel Facts

Move date out one month or year
Use =EDATE(A2,1) for one month later. Use EDATE(A2,12) for one year later.

Forum statistics

Threads
1,216,788
Messages
6,132,701
Members
449,753
Latest member
swastikExcel

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