What does "move between sheets" mean to you?
Does it mean to activate first one sheet, then another specific sheet?
Public Sub test1()
If ActiveSheet.Name = "Sheet1" Then
Sheets("Sheet2").Activate
Else
Sheets("Sheet1").Activate
End If
End Sub
To activate all sheets sequentially in the workbook?
Public Sub test2()
If ActiveSheet.Index = Sheets.Count Then
Sheets(1).Activate
Else
Sheets(ActiveSheet.Index + 1).Activate
End If
End Sub
To perform an action on more than one sheet, but not activate them?
Public Sub test3()
Dim wsSheet As Worksheet
For Each wsSheet In Worksheets
'Do something
Next wsSheet
End Sub
Something else entirely?
Did you really mean *function*? Worksheet functions, including User
Defined Functions can only return values to their calling cells - they
can't activate or select other cells, change the value of another cell,
or change formatting, etc.