Excel VBA delete worksheet based on worksheet name

Solution to delete worksheet based on worksheet name I am providing the solution for the "Deluxe-Plus" version in the below code To determine which worksheet is to delete, create an array called delWS(), and then loop through all the worksheet name to find the worksheet name that contains "DELETE" or "OLD". If (InStr(WS.Name, "DELETE") <> 0 Or InStr(WS.Name, "OLD") <> 0) And InStr(WS.Name, "KEEP") = 0 Instr function is to check whether the worksheet name contains the key w...
Read More

Excel VBA change cell range to array

  Solution to change cell range to array In the below solution, I have made a Sub to define array (defineArray), a Sub to delete worksheet(delWS), a Sub to move worksheet(moveWS) First, I define an array at Module level, so that all Sub within the Module can access the array. In Sub defineArray(), I put all the items from Range A4 to the last row of column A into wsArray() In Sub delWS(), I put "On Error Resume Next" to prevent error message when Macro tries to delete a wor...
Read More

Excel VBA Check cell value and cell value above

This tutorial provides a solution to check the Excel cell value and the cell value above in Excel worksheet using VBA. Check cell value and cell value above This was originally a question posted in Microsoft Community. I extract it to illustrate an example how to check Excel cell value and cell value above. Question Given a range of 12 cells in a row filled with only 0's and 1's... Would anyone know a way to return a true or false in a cell if looking in all the above cells, a 0 appeare...
Read More