macro to Insert one named range at numerous changing rows containing the macro button inserting relative to the position of macro button used

jtatt

New Member
Joined
May 1, 2019
Messages
32
The copy and insert on macro “InsertAtLevel1” functions to copy the named range “l1insert” and paste at a row named range “insertPointL1”

At the moment there are two reports site ABC and site DEF. But user my create further reports from the “l1insert” template
The level 1 insert is working ok

I would like to know, is there a way to insert the range “level2insert” relative to the button it is activated from?
"level2insert" range is currently rows 67:73

e.g. for rows 5:20 D13 button would insert “level2insert” at row 20 , for rows 21:36 D29 button would insert “level2insert” at row 36. There may be more “l1insert” at “insertPointL1” named row currently row 37 with a button in column D requiring “level2insert”




Book1
ABCDEFGHIJKLMNOPQRS
1
2report # 10Milestone
3#REF!OutputControlling pest animals - initial (ha)Q Target10
4
51. Click to copy and complete this box for each site where pest control occurred (below)
6Site name
7ABC
8Hectares of pest control delivered
9
10Initial or follow-up control
11
12
132. Click to copy and complete these rows for each species targeted at each site (below)
14Target pest speciesType of control
15
16
17
18
19
20> level 2 insert
211. Click to copy and complete this box for each site where pest control occurred (below)
22Site name
23DEF
24Hectares of pest control delivered
25
26Initial or follow-up control
27
28
292. Click to copy and complete these rows for each species targeted at each site (below)
30Target pest speciesType of control
31
32
33
34
35
36> level 2 insert
37> level 1 insert
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57TEMPLATES
58
591. Click to copy and complete this box for each site where pest control occurred (below)
60Site name
61
62Hectares of pest control delivered
63
64Initial or follow-up control
65
66
672. Click to copy and complete these rows for each species targeted at each site (below)
68Target pest speciesType of control
69
70
71
72
73
74> level 2 insert
Sheet1
Cell Formulas
RangeFormula
C2report # 10



in case my html generator is not working I put a copy of the file in dropbox
https://www.dropbox.com/s/entbtvkfi6dgsbp/level 2 copy.xlsm?dl=0

Thank you for any assistance
 

Excel Facts

Which lookup functions find a value equal or greater than the lookup value?
MATCH uses -1 to find larger value (lookup table must be sorted ZA). XLOOKUP uses 1 to find values greater and does not need to be sorted.

Forum statistics

Threads
1,224,822
Messages
6,181,165
Members
453,021
Latest member
Justyna P

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