From: FIRSTROUNDKO via OfficeKB.com on 11 May 2010 12:34 Hi, I am trying to input "WRONG" in COLUMN IV if the countif changes the cell colour. this part of the code is not working though Range("IV" & ActiveCell.Row) = "WRONG" 'MY FAILED CODE My full code: - OFFICECODESARRAY(1) = "DY:DY" OFFICECODESARRAY(2) = "EL:EL" OFFICECODESARRAY(3) = "EQ:EQ" OFFICECODESARRAY(4) = "HT:HT" OFFICECODESARRAY(5) = "HV:HV" For Y = 1 To 5 Step 1 For Each cell In Sheets("Import_Data_Here").Columns(OFFICECODESARRAY(Y)). SpecialCells(xlCellTypeConstants) If Application.WorksheetFunction.CountIf(Sheets("Office_codes").Range("A1: A700"), cell.Value) > 0 Then Else cell.Interior.ColorIndex = 6 'Validate Yellow Range("IV" & ActiveCell.Row) = "WRONG" 'MY FAILED CODE End If Next cell Next Y Thanks in Advance -- Message posted via OfficeKB.com http://www.officekb.com/Uwe/Forums.aspx/ms-excel/201005/1
From: Luke M on 11 May 2010 12:43 Do you really mean to refer to the ActiveCell? If there is no active cell, this could cause problems...perhaps you meant: Range("IV" & cell.Row) = "WRONG" -- Best Regards, Luke M "FIRSTROUNDKO via OfficeKB.com" <u15639(a)uwe> wrote in message news:a7da20cf1be4f(a)uwe... > Hi, > > I am trying to input "WRONG" in COLUMN IV if the countif changes the cell > colour. > > this part of the code is not working though > > Range("IV" & ActiveCell.Row) = "WRONG" 'MY FAILED CODE > > My full code: - > > > > OFFICECODESARRAY(1) = "DY:DY" > OFFICECODESARRAY(2) = "EL:EL" > OFFICECODESARRAY(3) = "EQ:EQ" > OFFICECODESARRAY(4) = "HT:HT" > OFFICECODESARRAY(5) = "HV:HV" > > For Y = 1 To 5 Step 1 > For Each cell In Sheets("Import_Data_Here").Columns(OFFICECODESARRAY(Y)). > SpecialCells(xlCellTypeConstants) > If Application.WorksheetFunction.CountIf(Sheets("Office_codes").Range("A1: > A700"), cell.Value) > 0 Then > Else > cell.Interior.ColorIndex = 6 'Validate Yellow > Range("IV" & ActiveCell.Row) = "WRONG" 'MY FAILED CODE > End If > Next cell > Next Y > > Thanks in Advance > > -- > Message posted via OfficeKB.com > http://www.officekb.com/Uwe/Forums.aspx/ms-excel/201005/1 >
|
Pages: 1 Prev: i want to convert decimals into time format Next: 2003 Filter and Sort Ascending |