Quantcast
Channel: VBForums
Viewing all articles
Browse latest Browse all 15765

Excel VBA - Auto find and fill blank cells with random yes or no

$
0
0
I need to fill blank cells in a specific column of a table whihc is connected to an online data source.
the code i currently have is:
Code:

Dim i As Long
With Sheets("Live Share Data")
Range("a1").End(xlDown).Select
Last_row = ActiveCell.Row

For i = 2 To Last_row

If Worksheets("Live Share Data").Cells(i, 11).Value = "" Then
   
    Worksheets("Live Share Data").Cells(i, 11).Value = Choose(RandBetween(1, 2), "Yes", "No")

    Next

End If
End Sub

the code currently breaks when it hits "Choose" any ideas where i have gone wrong here?


I have posted this on mrexcel forum but after little interest i have asked them to delete the post there. if i get any updates i will update in both locations.

Viewing all articles
Browse latest Browse all 15765