gogrant43 Posted February 25, 2018 Share Posted February 25, 2018 I am writing an AutoIT script that searches for values that are less than 5 from the range E2:E1000 (these values could only possibly be 1, 2, 3, or 4 in my case) and changes these values to 0. Using _Excel_RangeReplace, I am able to do this, but I have a problem. The problem is that any values above 5 that have a 1 in it (for example, 111 or 4912) are also changed to 0. How can I make it so that only the values 1, 2, 3, or 4 are changed to 0? _Excel_RangeReplace($oWorkbook, Default, "E2:E1000", int(1), 0) _Excel_RangeReplace($oWorkbook, Default, "E2:E1000", int(2), 0) _Excel_RangeReplace($oWorkbook, Default, "E2:E1000", int(3), 0) _Excel_RangeReplace($oWorkbook, Default, "E2:E1000", int(4), 0) This is the code I have so far for this. Link to comment Share on other sites More sharing options...
Subz Posted February 25, 2018 Share Posted February 25, 2018 (edited) Change the parameter for $xlpart to $xlwhole. _Excel_RangeReplace($oWorkbook, Default, "E2:E1000", int(1), 0, $xlwhole) Edited February 25, 2018 by Subz Example added Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now