View Single Post
 
Old 09-02-2016, 05:34 AM
p45cal's Avatar
p45cal p45cal is online now Windows 10 Office 2010 32bit
Expert
 
Join Date: Apr 2014
Posts: 871
p45cal has a reputation beyond reputep45cal has a reputation beyond reputep45cal has a reputation beyond reputep45cal has a reputation beyond reputep45cal has a reputation beyond reputep45cal has a reputation beyond reputep45cal has a reputation beyond reputep45cal has a reputation beyond reputep45cal has a reputation beyond reputep45cal has a reputation beyond reputep45cal has a reputation beyond repute
Default

Without row and column restrictions, try adapting NoSparks' code:
Code:
Sub blah()
On Error Resume Next
Set PickedRng = Application.InputBox("Use mouse to select", "TITLE HERE", Type:=8)
Intersect(PickedRng.EntireRow, Range("A:K")).Select
End Sub
NoSparks, note what happens with your code when a single cell is selected…

However, the OP did say "if a user selects a range of cells in any column between A to K" so perhaps:
Code:
Sub blah2()
Set MainRng = Range("A:K")
On Error Resume Next
Set PickedRng = Application.InputBox("Use mouse to select", "TITLE HERE", Type:=8)
If Application.Intersect(PickedRng, MainRng) Is Nothing Then
  MsgBox "Something within columns A to K please"
  Cells(1).Select
  Exit Sub
End If
Intersect(PickedRng.EntireRow, Range("A:K")).Select
End Sub'
Reply With Quote