I have a horizontal bar chart in which some of the bars represent positive values and others represent negative values.
How to format the bars so the "positive" bars are shaded in one colour and "negative" bars in another colour? I'd prefer not to change the bar colour manually as the values change frequently.
How to copy and paste conditional formatting with our changing the cell values. My first row of data starts in row 4 and here is what I have in D4
If D4 is less than or equal to AA4, AW4, BS4, CO4 then it will highlight D4
Now I want to copy that format and paste it for all rows in column D. The problem I'm having though is when I paste the formula it doesn't change to match the row I'm on. For example, when I paste it in D5 this is what I get
If D5 is less than or equal to AA4, AW4, BS4, CO4 then it will highlight D5
How do I paste it so that it will update to show AA5, AW5, BS5, and CO5. I want to be able to do this for 500 rows.
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.
I need a formula to use with conditional formatting that "lights up" the corresponding cells. So, in this case cells A7, A27, E3... should "light up". Is this possible, or should I use VB?
I have a spreadsheet that has multiples ranges. Some values are displayed as negative values. I would like to create a macro that allows me to first select the range/s, (maybe using a input box) I want to change and then display the negative values as positive values.
Would I need to create a separate macro to do the opposite (change the values that are positive to a negative value)?
The other macro I’m trying to create is a similar type. What I would like this macro to do is first select the range I want to change and then divide all the cells in the range by 100000
i have 118 cells and they are changing every 10 second so, how to gather the max value from these cells and displaly them in Marquee box or in pop message?
I am trying to populate many arrays with the same code using something like this. For this test, assume the following data in A1.
1 2 3 4 5
6 7 8 9 10
11 12 13 14 15
16 17 18 19 20
21 22 23 24 25
Code: Sub populate() Dim firstArr(5), secondArr(5), thirdArr(5), fourthArr(5), fifthArr(5) As Integer Dim r, c, num As Integer
[Code]....
The above code does not work of course and falls over. I am unsure whether I should try and concatenate with something like this eg "" & arrName(i) = Cells (r,c) or go down a different route.
i have a very large spreadsheet filled with telephone numberS and some other codes that go with them...i need to match the codes with the phone numbers.
Sub TRCO() Dim TNs As Long Dim i As Long Dim TempArray() As String Dim TRCO As String Dim CD03 As String Dim ASOC As Range TRCO = "TRCO" CD03 = "CD034DF1" 'Filter TN's Columns("B:B").EntireColumn.Insert Set tempRange = Range("A6", Range("A65000").End(xlUp)) With tempRange . AdvancedFilter _...................
I would like to fullfil a range a cell with different strings. As the cells are jointed to each others, I would like to pass the string array to the range and not to pass each string to each cell, to spend time.
I mean, with the function
Dim stTxt(3) As String range(Cells(1,1),Cells(3,1)).value=stTxt()
But I have some difficulties with this function: -if the range is a column, the function works, but if the range is a row, then only the first value of the array is passed, and to all the cells of the range -I didn't manage to use this function when using
Range(Cells(x,y),Cells(z,t))
and when the range is in another worksheet. I need to use
Cells(x,y).resize(z-x,t-y)
(I'm using Excel 2000).
how I can pass correctly my string array to a row of cells? (cf 1. point).
i have two arrays that I want to use in a trend function. I don't think i can just use the array as is in the fucntion so my guess is that I need to pass the array into a range of data, and help on how I can do this? (also this is in VBA, fyi)
I am trying to multiply a range of cells by a cell reference. The cells currently have hard coded values in them. I know with past special you can multiply a range of cells by a copied #. I want a similar function to that just instead of a copied cell its a cell reference. No VBA.
I'm trying to define a range of values in two cells M1:M2; lookup that range of values in a three column array (K12:M600) and sum the values in column M12:M600 if they are positive values. I've been trying this formula:
I have a list of names from cell A1:A10 in sheet "Input." Each of these names has its own corresponding sheet in the workbook. I want to be able to run the same exact VBA code for each sheet. In other words, I am trying to get my name variable to automatically change to the next value on sheet "Input." I'm sure this is pretty simple to do, but I can't seem to find anything that works!
On this is a column of Categories and a Column of sizes. I want to use these in a user form. The user will select their Category from a drop down list and the second drop down list will include only the sizes that appear next to the chosen category So for example in the attachment if the user chose 'AUD' as a category they would get the size choices of, '2x4 insert', '2x4 replica' and 'A4L' in the other drop down menu.
The master list of sizes will have to remain on a worksheet as this is what other operators will amend from time to time.
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] .......
Im using excel 2010 As it's 60 times quicker I was trying to speed up my code and replace all loops by putting the value into an array, and then transfer the array to the worksheet
It seems to be straightforward for math calculations like in this example:
[URL]
But no luck with the one below. I was trying to test it on a simple loop which replaces two types of string into the 3rd one:
Code:
Dim lastrow, lastrow2, i As Long With Worksheets("KPI5") lastrow2 = .Range("N" & Rows.Count).End(xlUp).Row .Range("T7:T" & lastrow2).Value = .Range("F7:F" & lastrow2).Value For i = 8 To lastrow2 If .Range("T" & i).Value = "Modification" Then
This may have been answered on here but can not seem to find it. My situation is I have values in A1,A2 & A3 that are like counter reading so the value is always changing. What I am looking to do is change the cell color if one of the values is over 500 from the other two values. Say A1 is 3000, A2 is 3250 and A3 is 3500. I would like the cell for A3 to change color.
I have a series of columns (L - X) each representing a diagnosed disorder (Dx), coded as binary, with 1=Positive Diagnosis (Success). The reference cell contains diagnostic codes; for each respective Dx column I need a 1 or 0, obviously. Each Dx category has a range of values (Dx codes), so I need to write syntax that reflects this range. For example, =IF(A1=>141,AND(A1=<239.99)),"1","0")
In other words, if cell value is 141 through 239.99 then return 1, else 0
Would it be something like this: =IF(AND(A1=>141,OR(A1=<239.99)),"1","0")
I have a class module with several private variables, including one that is an array of a user-defined type. I am trying to set the values of a single element of this array with "Property Let ..." from a string array:
I wrote this code that works on named ranges fine as it was originally intended!!
Dim Arr, Cel Arr = Array("MainName", "PostCode", "SourceOfBusiness", "CallOrientation", _ "URN", "ApplicationReference", "ACFRep", "BranchSalesperson", "Branch")
For Each Cel In Arr If Range(Cel) = "" Then MsgBox Cel & " is empty, please fill in and try again!" Range(Cel).Select Exit Sub End If Next How can I amend this to work against Textbox's in the array..?? Textbox2, Textbox4 etc etc?!?!