VBA Creating Name Range after Pasting Data Over Current Named Range

Magdoulin

Board Regular
Joined
Jan 11, 2013
Messages
73
Hi guys, I hope you’re doing well, I need a big favor from you as it’s going to be complicated code here

I need a code to check if named range is there or not by checking the value of cell M3 in sheet Home

If it exists, to go to the sheet where this named range is there and select it

If it doesn’t exist, so, we need to create it by:
- Going to the sheet name displayed in cell M1 in sheet Home
- Checking the next available empty cell in column C and name it with the needed range name displayed in cell M3 in sheet Home

However, the coming is the hard part
- That later on, there’ll be data pasted over number of cells including the one represents the named range and I need the named range to be redefined to include this new area
- It’s expected that the new area will start from the direct next left cell from the named range cell down to the last non-empty cell in column C expanding till the right to Column O

Is it doable?


P.S.
this was originally posted in OzGrid forum as I could attach the sample file there whereas it's not available here, if you need to check it please visit this link:

https://www.ozgrid.com/forum/forum/...e-after-pasting-data-over-current-named-range
 

Excel Facts

How can you turn a range sideways?
Copy the range. Select a blank cell. Right-click, Paste Special, then choose Transpose.

Forum statistics

Threads
1,223,911
Messages
6,175,333
Members
452,636
Latest member
laura12345

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