Question: JS: 

```
function clearSlides(){

    var myNode = document.getElementById("modal_content");
    while (myNode.firstChild) {
      myNode.removeChild(myNode.firstChild); 
    }
  }

```

This is my code for a function that deletes all of the inner elements within #modal\_content. But I need it to ignore elements that have a certain class (whatever that class may be). For example if I have 3 elements with classes .a .b and .c I'd want it to delete everything except the these elements. But I can't figure out how to do this.

Answer: 
Don't use `.Select` if you can possibly avoid it and most of the time, you can.

Try using `With...End With` constructs instead. Be as specific as you can with the object you want to operate on.

```
Sub SearchK()
Dim mycell1
Dim foundcell1a As Range

    mycell1 = 1
    With ActiveWorkbook.Worksheets("Sheet1").Range("K:K")
        Set foundcell1a = .Find(mycell1, .Cells(.Rows.Count, 1))
        Set foundcell1a = .FindNext(foundcell1a)
        If Not foundcell1a Is Nothing Then
            foundcell1a.Activate
        End If
    End With
End Sub

```

Without a `With...End With`, you would have to repeat all the object identifiers so:

```
 Set foundcell1a = .Find(mycell1, .Cells(.Rows.Count, 1))

```

Would have to be expressed as:

```
Set foundcell1a = ActiveWorkbook.Worksheets("Sheet1").Range("K:K").Find(mycell1, .Cells(.Rows.Count, 1))

```

When VBA is evaluating a command it needs to evaluate each property preceding a period (.) every time it encounters it. Using `ActiveWorkbook.Worksheets("Sheet1").Range("K:K")` gets rid of 4 periods so it runs faster too.

The `Set foundcell1a = .Find(mycell1, .Cells(.Rows.Count, 1))` is saying find `mycell1` after the last used cell in column K so it loops back to find the first instance in column K regardless of the active cell.
Try this:

```
With Range("K:K")
    Set LastCell = .Cells(.Cells.Count)
End With

Set FoundCell1a = Range("K:K").Find(mycell1, LastCell)
If Not FoundCell1a Is Nothing Then
    FirstAddr = FoundCell1a.Address
    Range(FirstAddr).Activate
End If

```

Hope this helps!