Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 65
Default Input in Column IV if countif satisfied

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(OFFICECODESARRA Y(Y)).
SpecialCells(xlCellTypeConstants)
If Application.WorksheetFunction.CountIf(Sheets("Offi ce_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.a...excel/201005/1

  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 457
Default Input in Column IV if countif satisfied

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@uwe wrote in message
news:a7da20cf1be4f@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(OFFICECODESARRA Y(Y)).
SpecialCells(xlCellTypeConstants)
If Application.WorksheetFunction.CountIf(Sheets("Offi ce_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.a...excel/201005/1



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Countif for finding a Time input Meebers[_4_] Excel Worksheet Functions 4 April 14th 10 01:21 AM
countif and sum if if two condition are satisfied zafar62 Excel Worksheet Functions 3 July 15th 08 06:22 AM
Looping till condition is satisfied? Jo[_2_] Excel Worksheet Functions 3 October 4th 07 09:43 PM
How to change the value of a cell when a condition is satisfied, but not otherwise? benzi_k_ahamed Excel Discussion (Misc queries) 0 January 11th 06 11:31 AM
Deletion of rows where a value is satisfied Larry Wallis Excel Worksheet Functions 1 February 22nd 05 12:41 PM


All times are GMT +1. The time now is 02:55 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"