Macro that when I select a name it pulls that clients data into a form like tab

tonywatsonhelp

Well-known Member
Joined
Feb 24, 2014
Messages
3,210
Office Version
  1. 365
  2. 2019
  3. 2016
Platform
  1. Windows
Hi everyone,
I have a tab that's set up to make it easy to input data
which is then moved to the "Events" tab as a list

I want to be able to pull the data back from the "Events" tab into the "Form" tab so more data can be added it can be edited etc.

So what I'd like is a way to run a macro that looks at the client name in Sheet "Form" cell D6
then goes to the "Events" tab and find the row that client is on

Then moves the following


Events Column D to Form Cell G6
Events Column R to Form Cell D8
Events Column H to Form Cell P4
Events Column L to Form Cell P5
Events Column S to Form Cell L6

any ideas how i can do this

Thanks

Tony
 

Excel Facts

Can you AutoAverage in Excel?
There is a drop-down next to the AutoSum symbol. Open the drop-down to choose AVERAGE, COUNT, MAX, or MIN
How about
Code:
Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
   Dim Fnd As Range
   If Target.Address <> "$D$6" Then Exit Sub
   Cancel = True
   With Sheets("Pcode")
      Set Fnd = .Range("A:A").find(Target.Value, , , xlWhole, , , False, , False)
      If Fnd Is Nothing Then
         MsgBox "Not Found"
         Exit Sub
      End If
      Range("G6").Value = Intersect(Fnd.EntireRow, .Range("D:D")).Value
      Range("D8").Value = Intersect(Fnd.EntireRow, .Range("R:R")).Value
      Range("P4").Value = Intersect(Fnd.EntireRow, .Range("H:H")).Value
      Range("P5").Value = Intersect(Fnd.EntireRow, .Range("L:L")).Value
      Range("L6").Value = Intersect(Fnd.EntireRow, .Range("S:S")).Value
   End With
End Sub
 
Upvote 0
Glad to help & thanks for the feedback
 
Upvote 0

Forum statistics

Threads
1,223,164
Messages
6,170,444
Members
452,326
Latest member
johnshaji

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top