Home |
Search |
Today's Posts |
#11
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() Hi Ikaabod Thanks for your reply. I tried it and nothing happened. I worked my way through the code an thought would this work instead Sub Test() Dim strValue1 As String Dim strValue2 As String Dim Criteria1 As String Dim Criteria2 As String Dim Criteria3 As String Dim Criteria4 As String Criteria1 = "NEG" Criteria2 = "LG" Criteria3 = "HGI" Criteria4 = "HGII" Criteria5 = "AGUS" Dim iRow As Integer Dim iTotalRows As Integer iRow = 0 iTotalRows = ActiveSheet.UsedRange.Rows.Count Range("A2").Select Do strValue1 = ActiveCell.Offset(iRow, 1).Value strValue2 = ActiveCell.Offset(iRow, 2).Value If (strValue1 = Criteria1 And strValue2 = Criteria2) Or (strValue1 Criteria1 And strValue2 = Criteria3) Or (strValue1 = Criteria1 An strValue2 = Criteria4) Or (strValue1 = Criteria1 And strValue2 Criteria5) Then ActiveCell.Offset(iRow, 3).Value = "FN" Debug.Print ActiveCell.Offset(iRow, 1).Address iRow = iRow + 1 Loop Until iRow = iTotalRows End Sub It didnt work either - no error messages or anything as on you original code. I saw on your code you had used the 'UCase' - probably because I ha used lowercase before however that was my mistake as 'Neg' is uppercas anyway. I have added an extra Criteria and called it 'NEG' an re-written the code slightly which hopefully will show a bit bette what I'm trying to achieve. Many thanks Stev -- ghobbi ----------------------------------------------------------------------- ghobbit's Profile: http://www.excelforum.com/member.php...fo&userid=1238 View this thread: http://www.excelforum.com/showthread.php?threadid=54120 |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Need to bold a cell based on keyword in another cell... | Excel Discussion (Misc queries) | |||
Populate cells based on key cell | Excel Discussion (Misc queries) | |||
auto populate cell based on previous cell drop down list selectio. | Excel Discussion (Misc queries) | |||
Insert text in Cell A1 based on keyword criteria | Charts and Charting in Excel | |||
Loop to change cell color based on found value? | Excel Programming |