I am having problems writing a VBA code so I need your help building it up in stages.…
- User
I am having problems writing a VBA code so I need your help building it up in stages. The first stage is described as below: Range B3:B1000 is mostly made up of empty cells. Some of the cells in the range contain a text value that are part of a repeating pattern as you move down the range. The revolving repeating pattern of values is ‘Monday, Tuesday, Wednesday, Thursday, Friday, Saturday, Sunday’. B3 always has a text value of one of the values in the repeating series. The code must first check the value in B3, identify the position of the value in the repeating series and then search for the next cell with a value and determine if the next cell is the expected next value in the series. The code must ignore all empty cells and continue the series pattern check until it gets to B1000 then it should stop the loop. If the code finds a next cell with a value and the expected value does not match the expected value in the pattern of the series, then the cell should be highlighted Yellow. Can you please write a VBA code to do this using this concept in the code to determine the next expected value. If current cell value is "Monday" then next cell value is "Tuesday" If current cell value is "Tuesday" then next cell value is "Wednesday" If current cell value is "Wednesday" then next cell value is "Thursday" If current cell value is "Thursday" then next cell value is "Friday" If current cell value is "Friday" then next cell value is "Saturday" If current cell value is "Saturday" then next cell value is "Sunday" If current cell value is "Sunday" then next cell value is "Monday"
- Assistant
Sure! Here is the VBA code to achieve the desired functionality:
vba