VBA to Copy range from Sheet to another and defined a name

Persl

New Member
Joined
Jun 29, 2020
Messages
14
Office Version
  1. 365
Platform
  1. Windows
Good day all

I need a vba code to do the following comands:

1 - copy range ("GT300") and ("GV300", Selection.End(xlToRight)) from ("Sheet1")
2 - H lookup ("Sheet1") ("GT291") on ("Sheet2").Range("B:B")
3 - Add the copied ranges from ("Sheet1") as new entery on ("Sheet2") based on the H lookup result
4 - Create new defined name from ("Sheet2") last entery from column D to last value on same row , Selection.CreateNames Top:=False, Left:=True, Bottom:=False, Right:=False
 

Excel Facts

Does the VLOOKUP table have to be sorted?
No! when you are using an exact match, the VLOOKUP table can be in any order. Best-selling items at the top is actually the best.
Define range.png
 
Upvote 0

Forum statistics

Threads
1,215,079
Messages
6,122,998
Members
449,092
Latest member
masterms

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