Named Range For Changing Data

Sep 25, 2007

I have created a macro (data on the left hand side) that allows me to copy data and paste it into an sql file. The problem i am having is that the data varies (e.g. data on the right) so this doesnt actually work. i was thinking of naming the values within the name ranges and then writing code to see if i can copy particular named range values but i dont know if this will work.

View 9 Replies


ADVERTISEMENT

Stop Graph From Changing Named Range To Formula Range

Sep 8, 2006

I am trying to create a graph for a range of data that updates monthly (adding an extra month each time). I wanted the graph source data to update automatically each time the data is refreshed so used an OFFSET formula to identify a named range. I then point the graph to the named range as the source data.

When I enter the range as the source data the graph picks it up. However, when I re-enter the source data option on the graph it has converted the named range into a cell written range (ie. replaces "=QUALITY" with "='Front page'!$B$7:$J$10" - which therefore will not update when the range increases.

View 4 Replies View Related

Named Range Name Keeps Changing On Its Own?

Apr 22, 2014

I have a master workbook ("database") containing many named ranges (ex "Contact"). I have another workbook template ("estimate") that I rename for each project and it too has named ranges (ex "Contact") referring to the named ranges in "database" (ex =DataBase.xlsm!Contact). I am saving "database" on multiple PC's and syncing to the cloud (skydrive / onedrive) so that I can access "database" from multiple PC's. What I'm finding is everything works fine as long as "estimate" or whatever I've renamed it is opened on the same PC it was created on.

If I open estimate on another PC the named ranges in estimate are renamed by addition of a prefix including the complete path to "database" (ex "='C:UsersJasonSkyDriveDocumentsDaikinServiceToolsDataBase.xlsm'!Component"). This renaming prevents the named ranges in "estimate" from working on other pc's because this specific path doesn't exist on other PC's, only the PC it was created on. Is there a way to name the named ranges in estimate by only the workbook name (=DataBase.xlsm!Contact) without the entire path being automatically added as a prefix?

View 5 Replies View Related

Dynamic Named Range Changing?

Feb 25, 2014

I am doing an Advanced Filter, and I am using a named range in my VBA code that decides the Criteria range.

The dynamic named range is called 'Criteria' and this is the code:

VB:
=OFFSET(Sheet1!$A$2,0,0,Sheet1!$BZ$23,41)

However, when I run the VBA code, although it works perfectly, afterwards the named range has changed to:

VB:
=Sheet1!$A$2:$AO$3

I just want this to remain unchanged, as it works great. This is my VBA code:

VB:
'Filter and send data to new sheet
Sheets("Sheet2").Select
Cells.Select

[Code]....

View 4 Replies View Related

Excel 2010 :: Changing Pivot Table Report Filter Via VBA With Named Range Or Array

Jul 21, 2011

I have a set of four pivot tables on a sheet that I need to programmatically change a Report Filter (Page Field) so I can create sets of reports in an automated fashion. This will be the first step in that process. The change will involve choosing > 1 Role each time the code loops through based on Named Ranges I've defined that are associated with that Role.

My code thus far:

Code:
Sub TestCode()
Dim pt As PivotTable
Dim pf As PivotField
Dim pi As PivotItem

[Code]....

emm_dc_gsr is one of many Named Ranges that will contain a variable number of elements. Just using the one right now to see if I can get the code to work, I'll eventually make another Named Range/Array of all them so I can loop through each Report ("ReportPick").

I want the Report Filter to consult that Named Range for its values and apply those values to PivotField "Role" that is used as a Report Filter.

When running this code above, I get a "Role" Field that says "All" but no values (the table is completely blank), with no evidence as to why it'd be blank (all filters in every Report, Column and Row are working normally and are filled in). When I choose a value manually after the code is run, the pivot table values populate. Do I need to somehow index the Named Range in that loop? I'm just confused about this step right here:

For Each pi In pf.PivotItems
If pi.Value = RolePick Then
pi.Visible = True
Else: pi.Value = False

When I've run other versions of the code, I've gotten an array version of it to "work" using LBound and UBound, but it never chooses the right two values even though those are verified as stored in the array via a pass-through. It chooses the first few values in the Report Filter.

Here's the corresponding code for that:

For i = LBound(myArray) To UBound(myArray)
pf.PivotItems(i).Name = myArray(i, 1).Value
pf.PivotItems(i).Visible = True
Next

I do not care if I use an array or a Named Range. I just want something that is simple and works. Passing the values directly from the named range seems easiest to my brain, but I'm open to anything and I'm clearly missing something (probably silly).

I also have no idea why " .AutoSort xlManual, .SourceName, .EnableMultiplePageItems" is necessary though every piece of sample code I've seen seems to have some variation of it.

(Using Excel 2010, Windows 7.)

View 9 Replies View Related

Determining If Cell Is Part Of Named Range And What That Named Range Is?

Aug 16, 2014

Let's say you have a named range, Rng1, which consists of cells A1 & A2. In vba how would you report back what, if any, named range the following cells resides:

Code] .....

here are multiple named ranges so using intersect is not feasible. Essentially, through code, I will be given a range and I need to determine if that range if part of a named range.

View 5 Replies View Related

Clear Old Data And Add New Data Every Month, The Named Range Changes

Dec 13, 2008

I have 30 worksheets in a workbook in which the first sheet is called summary. The summary sheet has 29 formulas with all named ranges, so one named ranged per worksheet. The issue I have is when i clear old data and add new data every month, the named range changes on some worksheets not pointing to the correct range as previous month file even if I have $

View 9 Replies View Related

Using A Named Range In Data Validation

Feb 11, 2010

Is there any way to use a Named Range in the "Source" field in a Data Validation? I have multiple sheets in a workbook that have the same layout, and I am using alot of different Data Validations. My problem is that whenever I need to change, or add a choice to one of these, I have to go to each sheet and change the Data Validations that are effected by that change. Is there a way to use a "Named Range" or something to put all of my acceptable choices, for that Data Validation, in one spot. And make any changes I had to that field.

View 2 Replies View Related

Filtering Data With Named Range

May 24, 2013

Filtering data using named range

Code:
Sub FilterNamedRange()

Sheets("Des").Range("A2:E10000").Delete
Sheets("BASE").Range("A1:E10000").AdvancedFilter _
Action:=xlFilterCopy, _
CriteriaRange:=Sheets("cri").Range("Extract"), _
CopyToRange:=Sheets("Des").Range("A1:E1"), _
Unique:=True

End Sub

View 8 Replies View Related

Data Validation From Two Different Named Range Alternatives

Jan 28, 2013

I have a cell for which I need the only options for data to be entered from a list in two different tabs from which I understand cant be done but is it possible to have two drop down options for the same cell?

The attached spreadsheet should explain this slightly better...

View 9 Replies View Related

Transfer Data From One Named Range To Another Via A Userform

May 7, 2009

I have a range of data that is compiled from various cells that I have named as Range1. I then have another named range - Range2 which should be items selected from range1 and copied into range2. This is to enable other work to take place.

I have created an example userform with Range 1 shown but do not know the code to copy it over using a command button. Range 1 should not change. Also vice versa if possible i.e. remove the selected item from Range2 with another button.

View 5 Replies View Related

Sum Part Of Named Range And Pivot Data

Mar 14, 2012

I have a named range TOT_BUDGET. We use the current month number to access this range's index for current budgets.

=INDEX(TOT_BUDGET,3)

My quandary is that I need to calculate the YTD budget for one of our dashboards. So, I need to get months 1, 2, and 3 and SUM them. Next month I'll need to get 4 months, etc...

I've looked at SUMIF, but it needs to match against some sort of criteria... I don't have any numeric month labels on the budgets page. I cannot figure out what range/array I would match the month number to.

Now, I know the easy way would be to put a month number at the head of each column, reference that array and do the SUMIF. Blech.

Ideally, I would love to just be able to say =SUM(INDEX(TOT_BUDGET, 1-3)). Is there an Excel function that will let me select an array slice?

------------------------------

In addition, we are getting the Total Sales number out of Great Plains via an SQL query. We summarize many accounts using a pivot table. We then access this table by using the GETPIVOTDATA function.

GETPIVOTDATA("NETCHANGE",TSALES,"FISCALYEAR",CurrYear,"FISCALPERIOD",CurrMo)

Again, how can I do a total YTD?

Is there a way I can do something similar to a foreach loop in the cell formula? I'd like to avoid macroland with this if possible.

View 1 Replies View Related

Macro - Add Data To Existing Named Range

Mar 7, 2014

I have a named range "ABC", range is ("A1", "A3", "A5"). Now I need to use Macro to extend the range to ("A1", "A3", "A5", "A7"), that is, adding "A7" to the existing named range "ABC".

View 1 Replies View Related

Named Ranges On Multiple Sheets With The Same Named Range & I Cant Figure Out How To Do This

Jun 2, 2006

I need to create a named range on multiple sheets with the same named range & i cant figure out how to do this. EG :- I want to create a named range called "_SubUnitRows" on sheet1 starting from "A1:A50" & other named range again called "_SubUnitRows" on Sheet2 starting from "A1:A25" ...

View 2 Replies View Related

Making Named Range The Last Active Value Used Within Another Named Range?

Jul 19, 2013

I'm trying to make my named ranges remember the values of the last active cells used within another named range. The purpose of this is to make my charts dynamically change dependant on two criteria selected. My spreadsheet currently updates itself as and when I change the active cell within a single named range, dynamically changing the chart data by using Lookup based on the active cells value. However I want to get away from having several charts showing, I would like to have a single chart which dynamically changes based on a second selection. So the first selection is for a department (Facility) which changes the chart data relevant to that department, the second selection is to dynamically change the chart shown for the pre selected department.

Picture2.jpg

Using the following code when updating just one criteria with several charts

VB:
Private Sub Worksheet_SelectionChange(ByVal Target As Range)

If Not Application.Intersect(ActiveCell, [MeasureType]) Is Nothing Then
[valMeasurePicked] = ActiveCell.Value [code].....

which works fine but I'm not sure how to add a second selection criteria because my code uses Activecell. I thought that the VBA needed to set the last used value of a range as a variable and therefore allow the second criteria to be selected but am not sure how to put it into practice.

View 2 Replies View Related

Data Validation - Cell Reference To Named Range

Nov 7, 2012

If I have two cells and a named range mexico

A1, A2.

A1 contains the string: "mexico"
A2 is the cells that has required data validation (drop down list).

I want A2's validation reference to be dynamic, in the sense that I can it reference it to A1; converting the string "mexico" to a named range mexico

I tried inputting = INDIRECT(A1) into A2

But I lack clarity in my understanding of referencing.

What is the correct procedure here.

View 2 Replies View Related

Copy Data Over Based On Reference And Named Range?

Jul 22, 2014

I got a very technical sheet which needs your experience to work.

open the attached file below to see the workbook.

It has 3 different sheets. "RESULT", "INPUT" and "SWITCH"

On "RESULT" Cell (O11) is where the person would put a Reference.

This reference is then checked on the "INPUT" sheet column A.

From the first cell it appears in Column A, until the last cell it appears in Column A should be the Row Range (Blanks included).

But I want that range (Column A to G) to be copied to "Switch" sheet. Pasted in Cell A1 downwards.

In the "SWITCH" sheet I have already given all the GREEN Cell formated areas a name - INFO.

I want all the data in INFO to be inserted into "RESULT" sheet between row 18 and 19.

I have colour coded most of the areas for you.. And added a button from which the Macro / VBA should run when clicked.

View 1 Replies View Related

Data Validation List With Criteria Using Named Range

Oct 30, 2012

I have been tasked with creating a data validation list. My data is contained on a separate sheet from my data validation list. I am using a named range to use the data for my data validation list. However, I am looking to add a criteria to my data validation list so that it only is populated with values based on another column on my data sheet.

For example, if I have a data sheet called "Employee" and I have two columns. Column A is a list of employee names and I have named a range in column A as "EmployeeName". Column B is used to define the category of employee. This value is a letter, for example, "A", "B", "C", or "D". This column does not have a named range as I don't know if I need one to get this to work.

I would like the data validation on one sheet to use a list of employees of a particular class from another sheet. Straight forward validation is easy using a validation list with a formula =EmployeeName. But how do I only list employees that have a category "A"? For some reason, I cannot get some of the formulas I have found while searching this message board to work.

View 7 Replies View Related

RowSource To Reflect Data Added To Named Range

Nov 8, 2006

I have several ComboBoxes & ListBoxes on a Userform that populate by referring to Dynamic Named Range in the RowSource property. Also on the Userform is an area to edit/add/delete items in these named ranges. If I Add or Delete an item, the Named Range does not automatically resize--or at least the Menus don't "resize" accordingly--unless I unload the UserForm and load it back up. Is there a way to refresh these Comboboxes without reloading the UserForm?

View 2 Replies View Related

Dynamic Named Range In Chart Data Series

Nov 30, 2006

I am attempting to use a dynamic named range in a chart data series as described in Excel Hacks (Hack #42 and Hack #52).

Using Insert|Name|Define I have created a named range called CashFlowSaleChartDataRange that is set to the following value:

=OFFSET('Cash Flow-Sale'!$O$10,0,0,NumFlows,1)

When I subsequently assign a reference to this named range in the data series dialog it will accept the answer and my chart will adjust to reflect the updated range. However, if I return to the data series dialog, I now see the range address returned by the OFFSET function rather than the named range reference.

View 2 Replies View Related

Dynamic Named Range As Chart Source Data

Jun 16, 2008

I've read through every thread I can find about dynamic named ranges as source data for a chart. It seems as if everyone can get it to work but me. I have a chart on one sheet that needs to update dynamically from data on another sheet when a button is clicked. Here's my code that runs when I click the button:

Sub Update_Center_Chart()
Sheets("Center Data Chart").Select
ActiveSheet.ChartObjects("Center Data").Activate
ActiveChart.SetSourceData Source = Range("CenterData")
End Sub

I get the error message: "Type mismatch." The data is in B1:F2 on a different sheet. The formula in the named range, "CenterData" is this:=OFFSET('Center Data'!$B$1,0,0,COUNT('Center Data'!$B:$B),4). The data will expand by 1 row every time.

View 5 Replies View Related

Named Ranges Keep Changing Values

Oct 5, 2009

I have two defined ranges, and they keep changing to include the workbook name. XV2 =

View 3 Replies View Related

Data Validation Fails With Named Range Of Array Of Constants?

Oct 27, 2013

I've set up a Named Range that refers to an array of constants, e.g. MyRange ={1,2,3,4,5}. This appears to be fine since I can output the named range to a range of cells in a row (e.g. A1:E1) and see 1,2,3,4,5 (one value in each column).

I'd like to use MyRange as the source for a Data Validation list in a cell.

Normally data validation list sources must be vertical, so I've set MyRange =TRANSPOSE({1,2,3,4,5}). This appears to be fine since I can output the named range to a range of cells in a column (e.g. A1:A5) and see 1,2,3,4,5 (one value in each row).

When I set MyRange as the source for data validation however, it resolves to an error.

why this setup doesn't work?

Workbook detailing the problem attached. Attachment 273788 NamedRangeDataValidationArrayConstansts.xlsx

View 3 Replies View Related

Changing Chart Source Data Range

Nov 30, 2006

Each week I have to add a new column to a report and then update the source data of all the charts that use that newly added column. I am trying to create a macro that will use the last 12 columns of data located on a different worksheet as the range for the source data of the chart. I have attached an excel document that contains an example of how one of the charts that I am using looks and where it pulls the data from.

View 3 Replies View Related

Changing Named Ranges In Formulas With Dropdown?

Jan 25, 2012

I have a workbook with several sheets and named ranges like ES_Date, ES_Range, ES_Volume or MC_Date, MC_Range, MC_Volume. The 1st two letters are the name of the sheet where the named ranges are located (one is dates, another volume, etc.).

What I'm trying to do is calculate averages, extract maximum and minimum values from the the named ranges using a start and end date that are entered in cells "H6" and "I6". The formula I am using right now is:

{=AVERAGE(IF((ES_Date>=H6)*(ES_Date

View 2 Replies View Related

Countif- Use A Named Criteria As Well As A Named Range

Oct 25, 2009

if I can use a named criteria as well as a named range. In essence what I am looking to do is count certain cells that meet the criteria in a certain named named range,

View 9 Replies View Related

Combine Two Named Ranges Into 3rd Named Range

Mar 14, 2013

Merge two columns into one list in excel

I would like to combine List1 and List2 into a 3rd named range called List3. I was wondering if this were possible without using any additional cells/columns (i.e. I don't want to use Column C like in the example shown in the link above).

Here's the formula from the example:

Code:

=IFERROR(INDEX(List1,ROWS(C1:$C$1)),IFERROR(INDEX(List2,ROWS(C1:$C$1)-ROWS(List1)),""))

I've played around with it, but could not come with any that worked.

View 3 Replies View Related

Copy Named Range Data To Worksheet Based On Dropdown Or Combobox

Feb 10, 2013

I have a worksheet called "Lookup" with several dynamic named ranges (each is 1 column wide) including facility, department, shift, etc. On a summary worksheet in the same workbook I want users to use a dropdown or combo box (don't care what type) in cell B2 to select a facility and then based on their selection, copy the department named range data and paste it into the summary sheet beginning in cell A5 and paste the shift named range data into the summary sheet beginning in cell B5.

Example: user selects "AR Plant" from the dropdown or combo box and the data from the "AR_Rpt" named range is pasted into cell A5 and the "AR_Shift" named range is pasted into cell B5.

View 9 Replies View Related

Use A Named Range To Many Columns Are Added Or Deleted The Data Is Pulled Correctly

May 4, 2006

I have a spread sheet that I pull data from different columns on a particular row. The problem is the code I used works great as long as the column never moves from its current location. Is there a way to use a named range to make the following piece of code work, so no matter how many columns are added or deleted the data is pulled correctly?

View 2 Replies View Related

Changing Range Of Sumproduct Function Depending On Length Of Data Series

Feb 20, 2007

I have a small problem using the ‘sumproduct function’ which I am using it to calculate the area under curves using the following equation (=SUMPRODUCT((B10:B109-B9:B108)*(D10:D109+D9:D108))*0.5). However I have hundreds of curves to calculate the area under and the length of the data series for each curve is different, I am currently changing the length of the data series by hand. I have attached an example worksheet of 2 sets of data (the formula I am using at the moment is highlighted in blue – row 203). Is there are function or formula that I can use inside this equation to change the range of the formula depending on the length of the data series?

View 2 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved