try this replacement line

sh.Range(myvalue).Value = sh.Index