Another question involving ranges, along the lines of this thread.
I have a range of data (columns A thru J, and rows 1 to ‘varies’), with row 1 being a header row. One of the columns (column F) is Pay Code ID, a text field, with entries like 8%, 12%, 4%, OJT, and Not Applicable. One of the things I will be doing is calculating a new base salary after converting the Pay Code ID into a multiplication factor.
I am looking for a method to cycle through the rows and identify the rows where the value in column F is OJT. For those rows that have OJT in column F, I need to be able to change the existing value in Column E to Column E + $0.50. Then change the column F value from OJT to Not Applicable. For example, in using the below code I can AutoFilter the Range on Column F, but how do I change the values in Column E to $14.30 in row 65, $14.73 in row 373, $13.94 in row 413, and $11.54 in row 523 as shown below?
Sub OJTChange() Application.ScreenUpdating = False Dim oRange As String, strDel3 As String, rowNum As String, varCode arrCode = Array("OJT") rowNum = ActiveSheet.UsedRange.Rows.Count oRange = "A1:J" & rowNum For Each varCode In arrCode strDel3 = varCode Range(oRange).AutoFilter Field:=6, Criteria1:=strDel3 Range("A2", Selection.End(xlDown)).Select Selection.SpecialCells(xlCellTypeVisible).Select 'here is where the change base rate and change OJT would belong Next Selection.AutoFilter Range("A1").Select Application.ScreenUpdating = True End Sub
Can someone help me? Please.