
Dim z as string
' in A1 c'è Milano
Set z = Range("A1").Value
' in modo da avere la propietà in lettura _
e poi una cosa tipo
For Each C in Range("B1:B100")
C.Value = RND ... 'prendendo valori a casa fra t,u,v,z.
|
Dim c As Range
Dim i As Integer
Dim j As Integer
Dim kk As Integer
Dim Swap As String
Dim NRighe As Integer
Dim NColonne As Integer
Set c = Selection
NColonne = c.Columns(c.Columns.Count).Column - c.Column + 1
NRighe = c.Rows(c.Rows.Count).Row - c.Row + 1
If NColonne = 1 Then
Randomize
For kk = 1 To NRighe * 5
i = Int((NRighe * Rnd) + 1)
j = Int((NRighe * Rnd) + 1)
Swap = c.Cells(i, 1).Value
c.Cells(i, 1).Value = c.Cells(j, 1).Value
c.Cells(j, 1).Value = Swap
Next
End If |
