I am trying to get the Worksheet name by selecting one range and using the worksheet name instead of using ActiveSheet.
Dim target as Range
n1 as long
Set target = Application.InputBox(prompt:="index range", Title:="Range Select", Type:=8)
n1 = ActiveSheet.UsedRange.Row + ActiveSheet.UsedRange.Rows.Count - 1
Set target = Range(target.Cells(1, 1), target.EntireColumn.Cells(n1, 1))
How can I replace ActiveSheet by the sheet which is related to the target Range?
Thank you very much for your help.