Yes, but I think you'll need to be more specific on what you are trying to accomplish to get a better answer!
Both. You can include an If..Then structure inside a For Each loop, like
Dim Cell As Range
For Each Cell In Selection
If Cell.Value < 0 Then
Cell.Interior.Color = vbMagenta
Else
Cell.Interior.Color = vbGreen
End If
<do other stuff inside For..Each loop
Next Cell
Or you can call another macro from within a macro. So if the macro you want to call is called ColorNegativeCells you just mention it in the calling macro:
<do stuff>
<blah blah blah>
ColorNegativeCells
<do more stuff>
<etc.>
Another equivalent way is to include the Call keyword. Although it's not necessary, it may make the code clearer to someone:
<do stuff>
<blah blah blah>
Call ColorNegativeCells
<do more stuff>
<etc.>
HTH
Both. You can include an If..Then structure inside a For Each loop, like
Dim Cell As Range
For Each Cell In Selection
If Cell.Value < 0 Then
Cell.Interior.Color = vbMagenta
Else
Cell.Interior.Color = vbGreen
End If
--do other stuff inside For..Each loop--
Next Cell
Or you can call another macro from within a macro. So if the macro you want to call is called ColorNegativeCells you just mention it in the calling macro:
--do stuff--
--blah blah blah--
ColorNegativeCells
--do more stuff--
etc.
Another equivalent way is to include the Call keyword. Although it's not necessary, it may make the code clearer to someone:
--do stuff--
--blah blah blah--
Call ColorNegativeCells
--do more stuff--
etc.
HTH