Q: Combining duplicate lines and add quantity I am using the below lines of code. Instead of me having to highlight the range.  Is there a code that can select my data range? I'm getting stuck on the bolded line of code. I want the range to be selected automatically.
Sub MyEnterEvent()

   Set R = Application.Selection
    **Set R = Application.InputBox("select one Range:", "CombineDuplicateRowsAndSum", R.Address, Type:=8)**
    Set Dic = CreateObject("Scripting.Dictionary")
    arr = R.Value
    For i = 1 To UBound(arr, 1)
        Dic(arr(i, 1)) = Dic(arr(i, 1)) + arr(i, 3)
    Next
    R.ClearContents
    R.Range("A1").Resize(Dic.Count, 1) = Application.WorksheetFunction.Transpose(Dic.keys)
    R.Range("B1").Resize(Dic.Count, 1) = Application.WorksheetFunction.Transpose(Dic.items)
    Application.ScreenUpdating = True

End Sub

