Glasgowsmile
Active Member
- Joined
- Apr 14, 2018
- Messages
- 280
- Office Version
- 365
- Platform
- Windows
Hello!
In columns B2:B20 I have the Names of all the other sheets in the workbook and each sheet has information in it.
What I want to be able to do is click on, let's say B4 and it references the appropriate Sheet name and pulls that data range to L2 and continue that process for each B:B column title I click on.
I got it work once but can't seem to replicate it again. Any help would be greatly appreciate!
In columns B2:B20 I have the Names of all the other sheets in the workbook and each sheet has information in it.
What I want to be able to do is click on, let's say B4 and it references the appropriate Sheet name and pulls that data range to L2 and continue that process for each B:B column title I click on.
I got it work once but can't seem to replicate it again. Any help would be greatly appreciate!
Code:
Private Sub Worksheet_SelectionChange(ByVal Target As Range) If Not Intersect(Selection, Range("B2")) Is Nothing Then
If Selection.Count = 1 Then Exit Sub
If Selection.Value = "" Then Exit Sub
Sheets(Range("B2").Value).Range("A1:U50").Copy Range("L2")
End If
End Sub