work on multiple selection and selected ranges