named-ranges

Excel Formula: Using INDIRECT to get same row number with named range causes #VALUE! error

南笙酒味 提交于 2020-07-10 04:34:12
问题 Greetings Stack Overflow denizens! I am having an issue trying to get a formula involving INDIRECT to behave itself in conjunction with INDEX. When i use specific row values, the array works fine, but when i try and use INDIRECT to get current row number i get a #VALUE! error. For example: I have this in cell R108, and it works as it should: =IF(OR(ISERROR(INDEX(MODEL,SMALL(IF(OWNERID=N108,ROW(OWNERID)-ROW(INDEX(OWNERID,1,1))+1),1))),N108=""),"",INDEX(MODEL,SMALL(IF(OWNERID=N108,ROW(OWNERID)

Create dynamic named range in VBA that references ListObjects table

喜欢而已 提交于 2020-01-16 06:46:29
问题 I need to create a named range that refers to the last few rows of data in a ListObject table. While I can do it manually from the ribbon (Formulas > Define Name) I have to do this across 20 sheets with 3 ranges each. When I try this using VBA I get error 1004 and a warning that there's a problem with the formula and to remove the "=" if I'm not trying to enter a formula. Any ideas how to resolve this? Open a fresh Sheet1 to try my code. It'll create a ListObjects table and will try to create

Inaccurate output of Dynamic Named Range

早过忘川 提交于 2020-01-06 06:41:35
问题 I am using the exact same code to name a dynamic range in two workbooks. I use Workbook TestBook1 for testing the code before implementing it to the body of the general code in Workbook 111. The code is: Dim HDaER As Worksheet Dim HDaERReturnLR As Long Dim HDaERReturnLC As Long Dim HDaERReturnsDNR As Range Dim HDaERReturns As String Set HDaER = Sheets("HistoricalDataandExcessReturns") With HDaER.Cells(108, 2).CurrentRegion HDaERReturnLR = .Find(What:="*", After:=HDaER.Cells(107, 1), _ LookIn:

Set a Chart series source to a named range via Macro

删除回忆录丶 提交于 2020-01-03 05:46:30
问题 I have a sheet with a existing chart and the proper dynamic named ranges to feed that chart the right data. My problem comes that the sheet is a template that is copied and the copies' charts don't point to the named ranges anymore. The named ranges get copied to the sheet (the ranges are sheet specific) so it seems like it should be a matter of just updating the series source data. Good old record gave me the following syntax when I recorded doing that manually: ActiveChart.SeriesCollection

loop through names and delete those not matching specified pattern

落爺英雄遲暮 提交于 2019-12-30 15:41:28
问题 I have a Excel workbook in which I import sheets from several other workbooks and then merge the data from these into an "overview" sheet. I am fairly new to vba so this task has taken quite some time, and alot of research. However I have one problem that i cant solve or find an answer to, but i think it should be fairly simple to solve if you know how. (so hopefully someone out there do.) Problem: When i import the sheets i also import a lot of unwanted named ranges. I have attempted to

Excel VBA: Workbook-scoped, worksheet dependent named formula/named range (result changes depending on the active worksheet)

霸气de小男生 提交于 2019-12-28 12:28:12
问题 EDIT: Title changed for clarity. Quick summary: I want to know if the behavior of workbook-scoped, worksheet dependent named formulas (which I will describe below) is a documented feature in Excel. If so, please point me in the direction of some documentation somewhere- I can't seem to find ANYTHING about this online (perhaps I'm using bad search terms..?) and don't want to be using something that is actually a bug and could disappear in a later version! Strictly speaking this is not really a

Populate list box with a named range

我们两清 提交于 2019-12-22 11:25:30
问题 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 to select their name before submitting the form Employee names are stored in a named range on "Sheet11" called "EmpName". I want to direct the list box to draw the list of names from the "EmpName" range on Sheet11; but don't know how I would do this

Google spreadsheet - Error when Remove range protection

情到浓时终转凉″ 提交于 2019-12-22 01:36:08
问题 Here's my script, but I can't get it to work for some weird reason??!!! Driving me nuts. function removeThenSetProtection() { // Remove all range protections in the spreadsheet that the user has //permission to edit. var ss = SpreadsheetApp.getActive(); var protections = ss.getProtections(SpreadsheetApp.ProtectionType.SHEET); for (var i = 0; i < protections.length; i++) { var protection = protections[i]; if (protection.canEdit()) { protection.remove(); } } } 回答1: Change: var protections = ss