Hi Pros,
I have already written some sub-routines and in my each sub-routine there are two common piece of code. 1. Checking for curtains sheets from which I don't want to take data. 2. The sheet from which I want to take data should be empty of its its B2 cell.
For Each ws In ThisWorkbook.Worksheets
If ws.Name = "Temp" Or ws.Name = "MasterSheet" Or ws.Name = "MachineCodes" Or ws.Name = "ExtraOrder" Or ws.Name = "ManualMachineCode" Or ws.Name = "MachineCodeSummary" Or ws.Name = "Procurement" Then
Else
If ws.Range("B2") = 0 Then 'Ignore the sheet if zero Board
Else
Each time I run a different sub routine i do need to set these lines of code. Is there any way to write code once and use in all sub routines.
Thanks
I have already written some sub-routines and in my each sub-routine there are two common piece of code. 1. Checking for curtains sheets from which I don't want to take data. 2. The sheet from which I want to take data should be empty of its its B2 cell.
For Each ws In ThisWorkbook.Worksheets
If ws.Name = "Temp" Or ws.Name = "MasterSheet" Or ws.Name = "MachineCodes" Or ws.Name = "ExtraOrder" Or ws.Name = "ManualMachineCode" Or ws.Name = "MachineCodeSummary" Or ws.Name = "Procurement" Then
Else
If ws.Range("B2") = 0 Then 'Ignore the sheet if zero Board
Else
Each time I run a different sub routine i do need to set these lines of code. Is there any way to write code once and use in all sub routines.
Thanks