I have a small macro running which puts a list of names in random order, then splits the list into two separate lists based on the total number of names in the list.
In the macro, I set up start and end of the range as two strings 'srange' &' erange'. The start and end cells references are held in cells B79 & B80 respectively. These cell refs change depending on total number of names.
Everything works fine in Microsoft 365, but I get a Runtime Error 13 - Type Mismatch at the first line in the code below, when I run the macro in Excel 2013.
Any ideas what I could be doing wrong? I've already had to change my code for 2013 because it gave a 1004 error when I used INDIRECT to pick up the cell references from B79/B80.
Any help appreciated.
Dim sRange As String, eRange As String
sRange = ActiveSheet.Range("B79"):
eRange = ActiveSheet.Range("B80")
Range(sRange & ":" & eRange).Select
Selection.Copy
Range("H2").Select
ActiveSheet.Paste
Bookmarks