ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   After Copy and Paste, Add to an Existing Named Range (https://www.excelbanter.com/excel-programming/384592-after-copy-paste-add-existing-named-range.html)

Aria[_2_]

After Copy and Paste, Add to an Existing Named Range
 
Hi,
I have named a range and when I copy a group of rows (with this range
included), I would like to update the new section to include this name
in its range. For example:

Row 7 to 26 is the entire group. D7 to O19 is called InputRange. When
I copy and paste this group anywhere on the spreadsheet, say, Row 27
through to Row 46, I'd like the range of D27 to O39 to be included in
the InputRange name.

This is so that I could update the fonts and formats for everything
located within InputRange.

Thank-you for helping me.

Aria :)

*** Sent via Developersdex http://www.developersdex.com ***

David Adamson[_5_]

After Copy and Paste, Add to an Existing Named Range
 
If you just need to update the formats of the cells why just not use
pastespecial ?


<Aria wrote in message ...
Hi,
I have named a range and when I copy a group of rows (with this range
included), I would like to update the new section to include this name
in its range. For example:

Row 7 to 26 is the entire group. D7 to O19 is called InputRange. When
I copy and paste this group anywhere on the spreadsheet, say, Row 27
through to Row 46, I'd like the range of D27 to O39 to be included in
the InputRange name.

This is so that I could update the fonts and formats for everything
located within InputRange.

Thank-you for helping me.

Aria :)

*** Sent via Developersdex http://www.developersdex.com ***




Aria[_2_]

After Copy and Paste, Add to an Existing Named Range
 
I wanted to code to format the range automatically because the users may
not always paste as values when they copy and paste data into my range.



*** Sent via Developersdex http://www.developersdex.com ***

David Adamson[_5_]

After Copy and Paste, Add to an Existing Named Range
 
Something like this will format an entire range into $

With Worksheets("capital")
.Range("b29:o48").NumberFormat = "$#,##0"
End With

<Aria wrote in message ...
I wanted to code to format the range automatically because the users may
not always paste as values when they copy and paste data into my range.



*** Sent via Developersdex http://www.developersdex.com ***




Aria[_2_]

After Copy and Paste, Add to an Existing Named Range
 
Hi David,
I have a template already setup that consists of about 20 rows or so.
Within these rows, I have named a specific range called InputRange.

Is there a way that if I keep copying and pasting these 20 rows over and
over again throughout the spreadsheet, that I could add the range to the
InputRange name?

That way, I could select all cells that are called InputRange and do any
formatting required by code Before_Save?

Thanks,
Aria :)

*** Sent via Developersdex http://www.developersdex.com ***


All times are GMT +1. The time now is 09:52 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com