Have a query that pulls general ledger data. Named Range SALES defined for Sales Account numbers. What is the best way to always have SALES (which pulls as negative number) converted to absolute values?
I have in my mind that it would be some sort of worksheet change event . . . but I don't really grasp the byval/byref TARGET concept by itself, let alone whether it can work on a named range.
I want to export data from a set of named ranges in workbook x to another set of ranges in workbook y. The names of the ranges to be exported from and to are spesified in a table "Table_Export". Problem is I do not want to spesify in what sheets these respective ranges are located, seeing that I do not know the actual sheet names. But since the ranges are global it should somehow be possible to reference them in vba without referencing the respective worksheet?
The relevant code can be found below where either of the two 'commented lines within the if statement are what I want to accomplish.
Dim x As Workbook Dim y As Workbook Set x = ThisWorkbook Set y = Workbooks.Open(Range("Export_to").Value) Dim export_control As ListObject
I'll attach an example.. I just can't seem to figure out how to update the range if I have already named it something using the Name Box to the left of the Formula bar.
I have 18 columns in a worksheet. (Let's say AA:RR). I've filled A1:R1 with the following series: WEEK 1,WEEK 2,.....WEEK 18.
I also have a named range (Start_Date) on another worksheet. Column 1 in that named range is WEEK 1, WEEK 2,......WEEK 18. Column 2 contains Start Dates for each week. If I input the following formula into cell A10:
How can I copy the Named Range definitions from one worksheet to another in the same workbook? In case it matters, the Named Ranges refer to cells in a third worksheet in the same workbook.
I put all my named ranges in a seperate worksheet in the workbook.
On a different sheet I have all my data with references to the named ranges. But what it gives me is the cell information from the sheet on which the named range is located and not on the worksheet where I actually need the calculations to be done.
How can I make the named range refer to the cells in the worksheet in which it sits?
Worksheet 1 --------------- 1 2 3 4
Worksheet 2 -------------- I name the function Red apples RedApples =CONCATENATE($A1&"Red Apples")
Question #1 How do I make the name reference in worksheet 2 refer to the cells located in the worksheet in which i use it. In other words, when I use RedApples in Worksheet 3, it gives me what is sitting in A1 in worksheet 2 instead of in A1 on Worksheet 1.
Question #2 How do I make the name reference in Worksheet 3 keep stepping down along Column A in Worksheet 1?
I am trying to set the value of a cell with the value of another cell, but using rangesNames. This syntax is failing: ActiveSheet.Range("starting_mileage") = "=ActiveSheet.Range("lot_mileage")". how do I structure this to allow it as flexibly as possible?
About 2 weeks ago Reafidy posted a reply to the following thread. Save Individual Sheet Based On A1. As I do not want to hi-jack anyone elses thread so I am starting a new one. The code posted does basicly what I need however I was wondering if it is possible to save only "ONE" specific sheet which could be specified in the code, to a specific folder specified in the code and under a name defined by a cells contents. eg.
Save a single sheet named "MatData" from a workbook, name the saved sheet from a "named range on sheet1" & "Cutlist" & ".xls" to a Folder on the "D" drive called "Saves"
I am working with a worksheet that has hundreds of named ranges already in-place. When the creator defined these ranges, they defined them all statically. I would like to update each named range to be a variable named range.
I was thinking about doing a massive find / replace in the VB Editor, but I can't seem to find the named ranges. I assume they were defined from within Excel by the Insert > Name > Define method, and not through VBA and that is why I can't find them. Is there any way to simplify this process instead of manually trying to update each and every range?
I am trying to find a way to create a list of unique items from a named range. I have found a few solutions using filters for ranges that are contained in the one column but not named ranges that contain multiple rows and multiple columns.
Is there any way to copy all of the unique items from the named range to another location? Lets call the named range Table1 and it spans from B2 to J100.
In cell A1, I have the month number (eg, 1, 2, 3,). The month number reflects current month and will automatically change with every month. For example, right now it’s 6, next month it will automatically change to 7. Each two columns in Range A10:X20 represents the data from January to December. I want to use a worksheet event to change the background of the current month two columns in the range to yellow color and the two columns in the range will be visible when I activate this sheet.
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.
I have a named range of values on Sheet2 (GPI). Sheet1 is an OLAP pivot table containing row label (GPI 14) and values (Net Rx Count) only.
Unfiltered this list is over 7,000 rows. I need VBA code to display only those rows where the GPI 14 value matches any value in the named GPI range on Sheet2.
In other words how can I display the select rows without manually selecting the items of interest AND without manually hard coding the values in the code as they will change.
Below is 1 of the many codes I tried. This appears to be the most intuitive but I get an 'invalid procedure" error at Set my PivotTable...
'Sub PivotAnalysis() ' Dim myPivotTable As Excel.PivotTable Dim myPivotField As Excel.PivotField Dim myPivotItem As Excel.PivotItem
I have an Excel workbook with multiple worksheets. One of the worksheets has a live data feed for stock updates. I extract data from the live feed (it's in multiple sentences) and pull it into 6 columns. In another worksheet, I pull those 6 columns into the sheet through the use of Index / Match. That second sheet has additional formulas that essentially analyze the data. As the data refreshes, the existing data moves down the column.
What I didn't think about was the fact that at times, a stock may be listed several times because different brokers are offering updates. Because I used Index / Match, it will look for the first match from the top and display that data in the relevant columns. Unfortunately, some of the data needs to stay with the matching row (and stock ticker) but because of the way I wrote the formulas in Index / Match, it just finds the first matching target and displays that data.
I can correct this by using an absolute reference ($) but I can't find a way to "copy down" formulas using absolute references. I also have one column of cells that contain 1 absolute reference and one relative reference.
I'll re-write this manually if I have to but I have 1,800 cells to change.
I have four named ranges (Segment, Keyword, Impressions and Dropdown) and I would like to create a formula-based ranking of keywords by impressions and clicks. Using the following array formula, I am able to return the correct values for impressions or clicks:
{=LARGE(IF(Segment=DropDown,Impressions),$H7)} where $H7 is the number ranking 1, 2, 3 etc.
My question is what array formula could be used to find which row in the array returned that number and then pulls the data from the same row in the other named ranges?
Essentially find row of {=LARGE(IF(Segment=DropDown,Impressions),$H7)} but return Keyword and Clicks on that row.
Other Notes: I cannot use pivot tables and some values might be the same which would make Vlookups not accurate for duplicate values.
Link to an example document to clarify this. [URL] .......
Is anyone aware of some way to use the " dynamic named range approach" to only select the cells with numerical values in a column and name this range?
I've looked at the examples on this site but can't find any solution to this particular problem although I have a feeling that this should be possible.
is it possible to write a macro that will convert absolute values into negative based on criteria? Data gets downloaded from in house system which comes out as all absolute values, now i need the macro to covert absolute values to negative if the amount is either "Our Reciepts" or "Our Delivery"
Below is a small sample of data, real data is around 100 rows
Col DCol EOur Receipts1231Our Delivery1231Delivery Settlement1323
Currently my Macro should: Turn off any filtersNumber column A from 1 to 1000 (starting in A14)Drags formula from K14-O14 down to last row of data shown in column Athen puts cursor in last empty cell in column B ready for user to enter data
On point 3 - I want the range to be K14-O14 if active worksheet equals "EXCHANGES" but if its on the "VALUATIONS" tab the autofill range should be L14-P14
I have found bits and pieces of macros on the internet and put them together so if my macro below is not the most effective for my needs but here it is in it's current state:
Here is my macro:
Sub AddNewEntry() 'TURNS OFF FILTER IF FINDS ONE ON Dim wks As Worksheet
i have a column with times of day and need a helper column to show the starting hour. for example, column a1 - 9:53am would like b1 to show 9am or 9. i tried customizing the date format to 'h' only, but when I pivot the table it still shows several 9's
How to change from absolute references to relative references.
Example : ws.Range("G" & NextRow).Formula = "=" & Range("H" & NextRow).Address & "+" & ws.Range("I" & NextRow).Address This code return the absolute references---> =$H$365+$I$365 , and i want change to relative references, like this ---> =H365+I365
This is a floowup to the issue that was originally posted as "Returning MAX/MIN values from multiple rows in a named range ". I marked that post as solved since I have worked through part of the issue and since have a different one.