navferty / NavfertyExcelAddIn

Common tools for MS Excel
MIT License
49 stars 6 forks source link

Apply action to single cell #44

Closed navferty closed 4 years ago

navferty commented 4 years ago

Describe the bug If single cell is selected, most actions apply to UsedRange - area of cells with values near selected cell.

In case of single-cell selection the action must be applied to that cell, not to entire UsedRange

To Reproduce Steps to reproduce the behavior:

  1. Select single cell that belongs to range of cells with values

image

  1. Click on 'Toggle case' or other function that update cell values
  2. All values in UsedRange were updated

image

Expected behavior Only selected cell was updated

image

Additional context

  1. Update GetSelectionOrUsedRange to return single cell if it is the only cell selected on active sheet.
  2. Ensure that all ribbon callbacks that update cell values, use the method GetSelectionOrUsedRange