rkol297
Board Regular
- Joined
- Nov 12, 2010
- Messages
- 131
- Office Version
- 365
- 2019
- Platform
- Windows
Hello I need VBA code that will lookin column D and for values:A, B, C, D, E, F, G rename all instances of these as Xthen in the same column forH,I,J,K rename all instaces of these as Zthen in the same column for valuesL, M, N, O, P, Q rename all instances as YI have a case code below that I like as I can add new values to it as in the future I may need to add values or remove current ones is there a way to do the above mentioned in this type of a code or is there a better way of doing it?Keep in mind the code below isnt being used to replace the values its just to illustrate that I like this code and the way its setup.
Code:
Sheets("RPH DAILY PRODUCTIVITY").Select Dim CelREMOVENONPAHIG As Range, RngREMOVENONPAHIG As Range, iREMOVENONPAHIG As Long Set RngREMOVENONPAHIG = Columns("D").SpecialCells(xlConstants, xlTextValues) For iREMOVENONPAHIG = RngREMOVENONPAHIG.Count To 2 Step -1 Select Case Range("D" & iREMOVENONPAHIG).Value Case "ACTP", "ADCC", "ADCR", "ALDZ", "ARAL", "BERT", "EPAC", "EPAP", "EPOP", "ELAP", "FL50", "F100", "FABF", "FABZ", "FLBO", "FPAP", "FZYR", "GAMC", "GAMS", "GGIV", "GGSC", "GKIV", "GKSC", "GLSA", "GMPX", "HIZA", "IVGB", "IVGF", "IVGP", "IVGS", "LETA", "LUMZ", "MYOZ", "NGLF", "NGLZ", "REMO", "REMP", "REVA", "REVC", "RMIP", " RMIV", "SILD", "TPAP", "TRAB", "TRAC", "TYVA", "TYVP", "TYVS", "VENP", "VENT", "VPRV", "ZEMA", "ZYME", "ZYMF" 'do nothing Case Else Rows(iREMOVENONPAHIG).Delete End Select Next iREMOVENONPAHIG