new Type mismatch error
new Type mismatch error
I've been using this macro successfully for some time and when I ran it today it suddenly gives a type mismatch error on line 8.
- Sub Randomcise2()
- Dim i as Integer
- Dim numSheets as Integer
- Dim thisRandom as Integer
- numSheets = ActiveWorkbook.Worksheets.Count
- Randomize
- For i = 5 To numSheets
- thisRandom = WorksheetFunction.RandBetween(5, numSheets)
- Worksheets(5).Move Before:=ThisWorkbook.Sheets(thisRandom)
- Next i