Linked Questions

Popular Questions

I need to skip empty cells in my vba button and open when is not empty

Asked by At

I have a button which opens a query of links whenever I click on it, however sometimes a field in my query is empty and I need my code to keep going and skip the empty cell, how can I solve that

I've already tried IsEmpty and couldn't reach the expected resultl. VBA world is quite new for me, so if you spot any silly mistake or not optimized method warn me. The code down here is from before I tried to skip the empty cells

Private Sub CommandButton1_Click()
    Dim SelecRng As Range

    Set SelecRng = ("F3:F44")

    Each Cell In SelecRng
    Set objShell = CreateObject("Wscript.Shell")
    objShell.Run (Cell)
    Next
End Sub

I don't wanna see the error whenever I try to open some links

Related Questions