![]() |
![]() |
|
|||||||
| Excel Questions All Excel/VBA questions - formulas, macros, pivot tables, general help, etc. Please post to this forum in English only. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Board Regular
Join Date: Mar 2002
Posts: 246
|
i have the following line of code. when run, an array in column A is given the name of the worksheet.
ActiveWorkbook.Names.Add ActiveSheet.Name , ActiveSheet.Range("A1:A10000") so, if the name of the sheet is USA, the array A1:A10000 is named 'USA'. how do i edit the code so that i can append a suffix to the name of the array? for example, i want the name of the array to be USA_June. basically, i want '_June' at the end of the worksheet name. thanks. mach3 |
|
|
|
|
|
#2 |
|
Board Regular
Join Date: Feb 2002
Location: Sheffield, UK
Posts: 249
|
Try this:
ActiveWorkbook.Names.Add ActiveSheet.Name & "_June" , ActiveSheet.Range("A1:A10000") |
|
|
|
|
|
#3 |
|
MrExcel MVP
Join Date: Feb 2002
Location: Sunny, spring-like Hull
Posts: 3,339
|
Try the following: -
ActiveWorkbook.Names.Add ActiveSheet.Name & "_June", ActiveSheet.Range("A1:A10000") Hope that helps you. Heh, beat me to it Phil [ This Message was edited by: Mudface on 2002-05-09 07:00 ] |
|
|
|
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|