title: VBA code to find max of last used column index within the selected rows
body: <p>I have a worksheet where there are many rows. I need to get the max column index of the last non empty column within a specified selected rows range.</p>
  
  <p>for example, the sheet contains 200 rows, each row contains 26 columns, but currently only rows 20 to 30 are selected. I need to find the maximum last used column index within these rows.</p>
  
  <p>Please note that there can be empty cells in between non-empty cells in a row. I need to consider the last non empty cell only.</p>
  
  <p>How can I achieve this?</p>