Help with current code for auto data to another sheet

Jennifer Van

New Member
Joined
Apr 22, 2022
Messages
41
Office Version
  1. 2016
Platform
  1. Windows
Hi
I have this code, which works fantastically, but since getting help on it, I have had to add some columns so the data previously was copied in columns j,k,l,m into Equipment Library Sheet, now I need then to be copied into columns u,v,w,x columns into Equipment Library Sheet.

Also whilst I have no trouble double clicking column 13 in the Loan Request Return Sheet to action the above, is there a way to do it while text is being inputted into the cells on this sheet in columns v,w,x,y?

Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)

If Target.Count > 1 Then Exit Sub
If Not Intersect(Target, Columns(13)) Is Nothing And Target.Row >= 5 Then

Dim Sval As Range, wsEL As Worksheet, wsLRR As Worksheet

Set wsLRR = Sheets("Loan Request Return")
Set wsEL = Sheets("Equipment Library")
Set Sval = wsEL.Columns("c:c").Find(Target.Value)

If Target.Value = Sval.Value Then
Target.Offset(, 9).Resize(, 4).Copy Sval.Offset(, 7)
End If
End If

End Sub
 

Excel Facts

Select all contiguous cells
Pressing Ctrl+* (asterisk) will select the "current region" - all contiguous cells in all directions.
VBA Code:
Target.Offset(, 9).Resize(, 4).Copy Sval.Offset(,18)
 
Upvote 0
Solution
You are very welcome
And thank you for the feedback
Be happy and safe
 
Upvote 0

Forum statistics

Threads
1,213,543
Messages
6,114,236
Members
448,555
Latest member
RobertJones1986

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