Dears,,
Using
SelectTypeRow SelectTypeCol SelectTypeCell
above properties how to set that user can select multiple cells but not in different columns.
for example
like below
col1 col2 col3
row1 *
row2 *
row3 *
and not like below
row1 * *
row2 * *
row3 * *
* implies cell is selected
Handle the BeforeSelectChange event, evaluate the e.NewSelections.Cells, and cancel the event if the selection violates whatever rules you have in effect.
In BeforeSelectChange event i tried like this
Dim hshchk As New Hashtable For i = 0 To e.NewSelections.Cells.Count - 1 If i <> 0 And hshchk.ContainsValue(e.NewSelections.Cells(i).Column.ToString()) Then hshchk.Add(i, e.NewSelections.Cells(i).Column.ToString()) Else e.Cancel = True Exit For End If Next
but no result
OMG! i made if statement wrong
it s working
thanks