How to cylce through selected spreadsheets?

I’m trying to cycle through spredsheets using basic. I found the code-snippet below. But how can I cycle through those sheets which are alread selected (e.g. multiple selection, but not those which are unselected)?
I found the object SelectedSheetsEnum, but how can I use it?
Any ideas?

Best wishes

Ulli

sheets = Thiscomponent.getSheets.createEnumeration 
While sheets.hasMoreElements
    oSheet = sheets.nextElement()
    MsgBox "Next sheet name is " & oSheet.getName
Wend

I think that you meant something like the following code

Sub cycleBySelectedSheets
Dim oCurrentSelection As Variant
Dim fullRangeAddress As String
Dim tmpArray As Variant
Dim oSheets As Variant
Dim oSheet As Variant
Dim i&
	oCurrentSelection = ThisComponent.getCurrentSelection()
	fullRangeAddress = oCurrentSelection.AbsoluteName
	fullRangeAddress = Join(Split(fullRangeAddress,"$"),"")
	oElementNames = Split(fullRangeAddress,";")
	oSheets = ThisComponent.getSheets()
	For i = LBound(oElementNames) To UBound(oElementNames)
		tmpArray = Split(oElementNames(i),".")
		oSheet =  oSheets.getByName(tmpArray(0))
REM Do something with this sheet... For example:
		Print "Processing " + oSheet.getName()
	Next i	
End Sub

But if you mean “select some sheets, with Ctrl key select some ranges on them and then work with each of this selections” so

Sub cycleBySelectedRanges
Dim oCurrentSelection As Variant
Dim oSheets As Variant
Dim oRanges As Variant
Dim oRange As Variant
Dim i&
	oCurrentSelection = ThisComponent.getCurrentSelection()
	oSheets = ThisComponent.getSheets()
	oRanges = oSheets.getCellRangesByName(oCurrentSelection.AbsoluteName)
	For i = LBound(oRanges) To UBound(oRanges)
		oRange = oRanges(i)
REM Do something with this range...
		Print "Processing " + oRange.AbsoluteName
	Next i	
End Sub

This is perfect! Works great. Thank you very much. Big respect and best wishes.
Ulli