Paul Bray-Boyce
New Member
Hello Everyone, I typically do not post questions because if you look hard enough someone else posted the same question or had the same challenges. I created / tweaked / modified Code that would take a range then randomly Select on of the cells then populate the data in a different cell (Source / destination) my code is attach and works as design.
My Question is would it be possible to 1. after copying the randomly select content from defined range to delete the selected item from the source. 2nd question is could there be an option that would some how save the original range content for "X" number of minutes in case I need to reset and source.
My Question is would it be possible to 1. after copying the randomly select content from defined range to delete the selected item from the source. 2nd question is could there be an option that would some how save the original range content for "X" number of minutes in case I need to reset and source.
Code:
Sub Teamshift10()
Dim SrcRange As Range, FillRange As Range
Dim c As Range, r As Long
Set SrcRange = Range("w56:y56")
Set FillRange = Range("u63")
If FillRange.Cells.Count > SrcRange.Cells.Count Then
MsgBox "Fill range too large"
Exit Sub
End If
r = SrcRange.Cells.Count
For Each c In FillRange
Do
c.Value = WorksheetFunction.Index(SrcRange, Int((r * Rnd) + 1))
Loop Until WorksheetFunction.CountIf(FillRange, c.Value) < 2
Next
End Sub
[code\]