ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Changing range names in VBA (https://www.excelbanter.com/excel-programming/308550-changing-range-names-vba.html)

Rob Slagle[_2_]

Changing range names in VBA
 
I have a worksheet that a 3rd party Excel application will populate
with data.

ie. the application will generate 5 files with an excel template.

the application will populate a certain cell with a value.

I want to take an existing range name on the sheet after the file is
generated and add an "_" and the value of the that certain cell that
got populated.

ie. existing range name = "lae4" cell value = "AL"
result desired is the range name would be "lae4_AL" and that the
"lae4" range name would be deleted.

Any ideas?

Rob

Tom Ogilvy

Changing range names in VBA
 
Range("Lae4").Name = "Lae4" & "_" & Cell.Value

ActiveWorkbook.Names("Lae4").Delete

--
Regards,
Tom Ogilvy

"Rob Slagle" wrote in message
m...
I have a worksheet that a 3rd party Excel application will populate
with data.

ie. the application will generate 5 files with an excel template.

the application will populate a certain cell with a value.

I want to take an existing range name on the sheet after the file is
generated and add an "_" and the value of the that certain cell that
got populated.

ie. existing range name = "lae4" cell value = "AL"
result desired is the range name would be "lae4_AL" and that the
"lae4" range name would be deleted.

Any ideas?

Rob




Rob Slagle[_2_]

Changing range names in VBA
 
Thanks alot for your help, this is going to help me get alot done.


"Tom Ogilvy" wrote in message ...
Range("Lae4").Name = "Lae4" & "_" & Cell.Value

ActiveWorkbook.Names("Lae4").Delete

--
Regards,
Tom Ogilvy

"Rob Slagle" wrote in message
m...
I have a worksheet that a 3rd party Excel application will populate
with data.

ie. the application will generate 5 files with an excel template.

the application will populate a certain cell with a value.

I want to take an existing range name on the sheet after the file is
generated and add an "_" and the value of the that certain cell that
got populated.

ie. existing range name = "lae4" cell value = "AL"
result desired is the range name would be "lae4_AL" and that the
"lae4" range name would be deleted.

Any ideas?

Rob


Rob Slagle[_2_]

Changing range names in VBA
 
How about some code to loop through all of the defined range names and
add the variable at the end and delete the old names, to where I don't
have to program each name one by one?


(Rob Slagle) wrote in message om...
Thanks alot for your help, this is going to help me get alot done.


"Tom Ogilvy" wrote in message ...
Range("Lae4").Name = "Lae4" & "_" & Cell.Value

ActiveWorkbook.Names("Lae4").Delete

--
Regards,
Tom Ogilvy

"Rob Slagle" wrote in message
m...
I have a worksheet that a 3rd party Excel application will populate
with data.

ie. the application will generate 5 files with an excel template.

the application will populate a certain cell with a value.

I want to take an existing range name on the sheet after the file is
generated and add an "_" and the value of the that certain cell that
got populated.

ie. existing range name = "lae4" cell value = "AL"
result desired is the range name would be "lae4_AL" and that the
"lae4" range name would be deleted.

Any ideas?

Rob



All times are GMT +1. The time now is 03:49 AM.

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