D
Dave Neve
Hello
I have a simple macro that chooses a line in a table at random to test
students on their vocab.
I have split a cell in the last column and now the macro produces the error
'Collection Object not found'.
I don't understand why one cell being split can cause this macro to fail.
After all, the table still exists and it selects the table while the number
of lines remain the same.
If someone indicate where the problem lies...
Thanks
Sub RandomPick()
'
' RandomPick Macro
' Macro créée le 18/06/2005 par Dave Neve
'
Dim i As Long
Dim j As Long
i = Selection.Tables(1).Rows.Count
Randomize
j = Int((i * Rnd) + 1)
Selection.Tables(1).Cell(j, Selection.Tables(1).Columns.Count).Select
Selection.HomeKey
End Sub
I have a simple macro that chooses a line in a table at random to test
students on their vocab.
I have split a cell in the last column and now the macro produces the error
'Collection Object not found'.
I don't understand why one cell being split can cause this macro to fail.
After all, the table still exists and it selects the table while the number
of lines remain the same.
If someone indicate where the problem lies...
Thanks
Sub RandomPick()
'
' RandomPick Macro
' Macro créée le 18/06/2005 par Dave Neve
'
Dim i As Long
Dim j As Long
i = Selection.Tables(1).Rows.Count
Randomize
j = Int((i * Rnd) + 1)
Selection.Tables(1).Cell(j, Selection.Tables(1).Columns.Count).Select
Selection.HomeKey
End Sub