這段程式若要寫成函數該如何?(編號:8881)

這段程式若要寫成函數該如何?
Private Sub Command1_Click()
STRx = "123456789"
For i = 1 To Len(STRx)
S = Mid$(STRx, i, 1)
Print S
Next
End Sub