I have a report template that is used by a test software to printout report. This software will include test measurements and results and can run small macros.
My template includes all possible limits for a test, and depending on the standards used for the test I want to have it delete the limits not used.
I am trying to look for 3 different strings (corresponds to EMC standards title) to see If i need to delete some rows that are specific to one of those standards.
Basically if I have 55015 in the standard list i keep all rows, but if i don’t have it and i have either 55032 or 55014 i delete 2 rows.
here is my code:
Sub Define_Limit()
If InStr(Range("E8:J9").Value, "*55015*") = 0 Then
If (InStr(Range("E8:J9").Value, "*55032*") = 1 Or InStr(Range("E8:J9").Value, "*55014*") = 0) Then
Cells(68, 2).EntireRow.Delete 'deleting the row with extra limits i.e. 9k-->150KHz
Cells(69, 2).EntireRow.Delete
Cells(100, 2).EntireRow.Insert
Cells(101, 2).EntireRow.Insert
End If
End If
End Sub
I also tried this:
If (((CountIf("E8:J9", "*55032*"),True,False) = True) Or (CountIf("E8:J9", "*55014*"),True,False) = True) Then
If (((CountIf("E8:J9", "*55015*"),True,False) = False)) Then
Cells(68, 2).EntireRow.Delete 'deleting the row with extra limits i.e. 9k-->150KHz
Cells(69, 2).EntireRow.Delete
TeaBot is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.