ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Create a macro (https://www.excelbanter.com/excel-discussion-misc-queries/241494-create-macro.html)

Ulrikke

Create a macro
 

Gary''s Student

Create a macro
 
This small example is coded for rows 5 thru 10.

Adapt it to meet your needs:

Sub ColorMeElmo()
For i = 5 To 10
Set r = Range("A" & i & ":H" & i)
If Cells(i, "A").Value = "OK" Then
r.Interior.ColorIndex = 43
GoTo doneRow
End If
If Cells(i, "H").Value = "N.S." Then
r.Interior.ColorIndex = 46
GoTo doneRow
End If
If Cells(i, "G").Value = "P.S." Then
r.Interior.ColorIndex = 44
GoTo doneRow
End If
If Cells(i, "G").Value = "Y.L.K" Then
r.Interior.ColorIndex = 39
End If
doneRow:
Next
End Sub

--
Gary''s Student - gsnu200902


"Ulrikke" wrote:

HI



I need help after I tried for 2 day to make a macro in excel not a
conditional formatting, as I need to share the document with people who
has a Mac Excel 2008



What I need it to colour the entire row (from column A to H) lines
depending of the owner or if task is over.



Rules a



First Strongest priority:

If Column A is OK entire row (column A to H) is green [Color 43]

If true stop



Second Priority

If column H is N.S. entire row (column A to H) is orange [Color 46]

If true stop



Third Priority

If column G is P.S. entire row (column A to H) is Yellow [Color 44]



Fourth Priority

If column G is Y.L.K entire row (column A to H) is Purple [Color 39]



Please can any one help me create the macro, see the conditional format i
try to create as macro in attached document.



Thank you in advance


Chip Pearson

Create a macro
 
I believe that Mac Excel 2008 doesn't support VBA.

Cordially,
Chip Pearson
Microsoft Most Valuable Professional
Excel Product Group, 1998 - 2009
Pearson Software Consulting, LLC
www.cpearson.com
(email on web site)

On Wed, 2 Sep 2009 15:06:01 -0700, Gary''s Student
wrote:

This small example is coded for rows 5 thru 10.

Adapt it to meet your needs:

Sub ColorMeElmo()
For i = 5 To 10
Set r = Range("A" & i & ":H" & i)
If Cells(i, "A").Value = "OK" Then
r.Interior.ColorIndex = 43
GoTo doneRow
End If
If Cells(i, "H").Value = "N.S." Then
r.Interior.ColorIndex = 46
GoTo doneRow
End If
If Cells(i, "G").Value = "P.S." Then
r.Interior.ColorIndex = 44
GoTo doneRow
End If
If Cells(i, "G").Value = "Y.L.K" Then
r.Interior.ColorIndex = 39
End If
doneRow:
Next
End Sub



All times are GMT +1. The time now is 03:24 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com