English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

The question goes like this. It says all macros should use range names, as opposed to specific cell references so insertions and deletions wont happen on the worksheet. I need to assign range names to specific cells. How do I do this.

2007-10-05 10:02:35 · 2 answers · asked by Anonymous in Education & Reference Homework Help

2 answers

Select the cell(s) you wish to name as a Range.
On the 'Insert' menu, click 'Name'.
In the list to the right, click 'Define'.
In the dialog box which appears, type the required name.
Click 'OK'.

2007-10-08 02:23:10 · answer #1 · answered by Anonymous · 0 0

You can do it like the first answerer said. If you are wanting to make a complex range or redefine what cells compose that named range then do it like the first answerer said.

For simple named ranges, just select your cells (hold down the Ctrl key for selecting multiple areas) then go to the Name Box in the top left corner of Excel right over the top of cell A1 where the cell location selected is displayed and type in the name you want for the selected range. After typing in the name make sure to hit the Enter key. If you don't hit the enter key it won't name the range.

And yes, the info you got regarding naming ranges instead of referring to specific cells is correct. Referring to named ranges will refer to the same cell or group of cells even if rows or columns of cells are inserted or deleted.

Say for example you want to reference the sum total of a column. The cell that has the total formula is currently in A21. If you reference cell A21 and someone adds another item to be added, you would get the last number in the list and not the total. But if you named the total cell MyTotal then referenced MyTotal in your coding. Excel would reference that cell wherever it was moved to, so you'd always get the total.

2007-10-09 10:31:10 · answer #2 · answered by devilishblueyes 7 · 0 0

fedest.com, questions and answers