Questions tagged [named-ranges]

A named range is a defined area, typically in a spreadsheet or document, used for future reference. A range can be one cell in a spreadsheet, or a range of cells.

Named ranges (or defined names) in spreadsheets are used to refer to one or several contiguous cells.

Ranges will automatically shift the while the layout of the Worksheet changes (adding or deleting rows or columns). Furthermore, named ranges can be defined with formulas.

609 questions
3
votes
1 answer

Excel VBA - Use array as criteria in autofilter, not expected results

The ultimate goal of this procedure is to delete all rows in the "TestData" table that have a user which is listed in the "SysAccts" table (on the "Lists" worksheet). I'm using autofilter to find those rows so I can select them and delete them.…
DeNaeL
  • 132
  • 1
  • 8
3
votes
5 answers

Averaging over a Non-Contiguous Named Range

I am trying to average non-contiguous cells as shown. I am taking the average of columns A and C for each row. I am trying to do the same but with a named range (including columns A and C), because my actual data have thousands of columns and it…
DGenchev
  • 327
  • 3
  • 12
3
votes
0 answers

EPPlus - How to rename a named range and maintain correct formulas?

I have an Excel file with a named range (just one cell). There are other cells who's formulas use this name. I am trying to programatically rename the cell using EPPlus. My first attempt I simply removed the old name and added the…
kilkfoe
  • 445
  • 5
  • 11
3
votes
1 answer

VBA: Range Syntax Confusion

What is the difference between Range("A1","A40").Select Range("A1:A40").Select Though both of them produce the same result. I would like to know the difference between them
Rohit Saluja
  • 1,517
  • 2
  • 17
  • 25
3
votes
2 answers

A variable of a Named Range (Excel) in a Userform gives me an error

I am very new to Excel-VBA (any kind of programming actually) and I am looking for help. I am trying to make a variable of a Named Range in a Userform (Excel-VBA), but when I try to use the macro with the created variable I receive an error:…
Simon
  • 137
  • 2
  • 8
3
votes
1 answer

Can Excel Ranges be jagged (rather than always contiguous)?

One can define ranges in C# Excel Interop like so: var homeHomeOnTheRange = _xlSheet.Range[_xlSheet.Cells[3, 7], _xlSheet.Cells[42, 11]]; This range will encompass the subset of cells on the page from row 3 down to row 42, and across from columns 7…
B. Clay Shannon-B. Crow Raven
  • 8,547
  • 144
  • 472
  • 862
3
votes
2 answers

How to test whether any non-header cell in Excel file is bold or italic

We use an Excel sheet which contains some business logic (and so it is often edited by non-IT). Some C++ code is generated in VBA from the same sheet - silly, I know. I plan to write a bunch of unit tests against this worksheet, ensuring strict…
Hamish Grubijan
  • 10,562
  • 23
  • 99
  • 147
3
votes
2 answers

Refer to an excel named range on another sheet using indirect

Let's say I have three sheets (let's say Sheet1, Sheet2 and Sheet3). Sheet1 and Sheet2 contain each a sheet-level range named MyRange. In Sheet3, if I want to access MyRange from Sheet1, I will just be able to use ='Sheet1'!MyRange. But now, I…
Samuel Albert
  • 149
  • 1
  • 1
  • 9
3
votes
1 answer

Convert excel named Range to a collection of rows

I currently have a method which takes in a dynamic named range in excel and converts it to a 2D array. I need to do some iterations to the data and carry out a Delete function if a certain column contains a value. I have looked at the options out…
Jetnor
  • 521
  • 2
  • 11
  • 26
3
votes
1 answer

Populate list box with a named range

I'm working on my first ever VBA project, and need a bit of absolute newbie guidance. I have a submission form that staff will be using to submit their daily KPIs. I have a list box control in a user form called "lstName" that employees will use…
cazzzac
  • 59
  • 2
  • 3
  • 9
3
votes
3 answers

Excel VBA - Any performance benefits between const string range or define names for ranges?

G'Day, I have a question more towards helping me understand on more about how Excel VBA can effectively manage defined ranges that have been declared in one place in order to execute data well. Just wanting to work out which two options (I know so…
Peter M Taylor
  • 183
  • 1
  • 9
  • 17
3
votes
2 answers

VBA Excel: Rename columns for easy referencing

I am writing a script that transfers data from Excel cells to different word tables. So far, I am doing it like that: wordDoc.Bookmarks("Editor").Range.Text = Sheets("Product Eval").Range("E" & evalRow).Text where evalRow is computed…
derMax
  • 355
  • 4
  • 7
  • 17
3
votes
1 answer

How to Move a NamedRange in Excel - VSTO not VBA

I've trawled the web and according to the documentation there doesn't appear to be a method to move a NamedRange: http://msdn.microsoft.com/en-us/library/microsoft.office.tools.excel.namedrange_methods(v=vs.80).aspx I have the following code that…
Jeremy Thompson
  • 61,933
  • 36
  • 195
  • 321
2
votes
1 answer

Add a static column to Named Range

I want to created a named range, which reorders a few columns and adds a new column with a static value in each row. Below is the formula I am trying to use for the new named range: ='Monthly Summary'!$S$7:$S$9,{"Income";"Income";"Income"},'Monthly…
2
votes
2 answers

Return the name of a named range based on cell?

Not sure if this is possible in Google sheets, but I'd like to search my named ranges for a value and return the name of the range where the value exists. If I have ranges "Alpha" and "Beta", and within Alpha is the value "first", when I type…