Change Source Of Cell By Changing Value Of Another Cell

Jan 11, 2013

See an example of the problem I'm having in this excel file with the explanation inside

example.change.values.question XLSX - Free Download - Uploading.com

I basically want the source of the data in a cell to be changed once another cell value is changed. I tried multiple formulas with no luck as well.

View 3 Replies


ADVERTISEMENT

VBA - Change Data Source Of Pivot Table With Range Changing Based On Cell Value?

Mar 5, 2013

I have the following code to update a pivot table:

Code:
Dim pt As PivotTable
Application.EnableCancelKey = xlDisabled
For Each pt In ActiveWorkbook.Worksheets("sheet1").PivotTables
pt.ChangePivotCache ActiveWorkbook.PivotCaches.Create _
(SourceType:=xlDatabase, SourceData:="source!R4C1:R33443C55" _
, Version:=xlPivotTableVersion10)

Next pt

the R33443 term is what will be changing, the columns and the starting row should stay the same. is there a way to instead of using R33443, to enable the range to be changed based on a cell value?

View 2 Replies View Related

Changing Value Of Cell By Change Of Value In Another Cell Using Dropdown List

Jun 7, 2013

I have a spreadsheet with numerical data in B1:B11 and textual data in C1:C11. The numerical data is a couple of digits, nothing big, and the textual data is always two letters, in this case AB, AC or AD. I have the options for AB, AC or AD for each of the cells in C1:C11 in a data validation drop down list. What I'm trying to do is make a VBA macro, of some sort, that acts upon when, AB for instance, is changed to AC, and then multiply the adjacent numerical value in the B column by a conversion value:

AB -> AC = 3
AC -> AD = 7
AD -> AB = 4

So for example, if I had cell B2 as 10 and C2 as AB, then changed AB to AC using the drop down menu, the macro would recognise the change, select the adjacent cell, B2, and multiply it by 3 to get 30, and put 30 in B2.

This is what I've got so far, and I'm no VBA expert, so I've probably made mistakes in multiple places. At the moment, the code below is getting stuck on active.celloffset - and I'm really not sure why. I did manage to get it working with specific cells rather than a range, but that only ever worked once and I had to close and re-open excel to get it to work again. Is my code any good, or am I coming at this from the wrong direction?

Code:
Private Sub Worksheet_Change(ByVal Target As Range)
Code:
Static ov As Variant
For Each Cell In Range("B1:B10")

[Code].....

View 9 Replies View Related

Change The Fill In The Changing Cell

Nov 24, 2008

How can I change the fill in the ChangingCell to, say, ColorIndex = 15, if the goal seek method is successful
Currently I've in a loop:

Cells(myrow, colSet).GoalSeek Goal:=Cells(myrow, colVal), _
ChangingCell:=Cells(myrow2, colChange)

View 9 Replies View Related

Change One Value Of A Cell Without Changing Others That Reference It

Apr 7, 2007

I am creating a schedule to use for our helpdesk - it has pre-defined tasks that need to be assigned each day - easy enough to accomplish with a formula. And I've done this by using this similar formula on each line of the tasks (This first task is based on a manual entery into one field (B19))
=IF(AND(B6="Liz"),"Paul",IF(AND(B6="Paul"),"Mark",IF(AND(B6="Mark"),"Diane",IF(AND(B6="Diane"),"Jeff",IF(AND(B6="Jeff"),"Dan R",IF(AND(B6="Dan R"),"Chris",IF(AND(B6="Chris"),"Liz","")))))))

So, B4 is one task (phones) and the formula above (B6) is from another task (tickets) and then a third task (admin) looks at the value of B5 and uses the same formula above, etc.

However, I want to be able to change the value of a single cell, based on the (manual entry) value of another (out of task) series of cells (i.e. Sick (B35) & vacation (B36)) - and I don't want any of the other task cells(in the C cell series of 'tasks'), that are basically linked together by the value of the other cell, to change. Thus, in turn, would mean that the same person would now be in two different cells, and thus is creating a circular reference.

Let me spell this out a bit clearer.
The first manual field is B19 - If I enter 'Chris' into this field, then field C5 matches it. Then field B6 uses the formula above to figure it's value; as does B7 thru B12.
Now, If I put another manual entry into 'Sick' (B35), then I want whichever task that person is assigned to (for this example, we'll say I entered 'Jeff" into Sick, and Jeff happens to be on 'tickets' that day) to change to whoever is in cell B12 - but I don't want any of the other cells to change - but, since they are all dependant on each other, this doesn't seem like a possibility.

I've tried creating a count of names in the Sick or Vacation fields and then added this to the formula
=IF(AND(C5="Liz", B38=0),"Paul",IF(AND(C5="Paul",B41=0),"Mark",IF(AND(C5="Mark",B40=0),"Diane",IF(AND(C5="Diane",B40=0),"Jeff",IF(AND(C5="Jeff",B43=0),"Dan R",IF(AND(C5="Dan R",B37=0),"Chris",IF(AND(C5="Chris",B45=0),"Liz",B12)))))))

B38 being Pauls count; B41 being Marks, etc - so as long as their count equals zero, they are 'eligible' to fill that slot.
B12 is the last person on the schedule.

View 8 Replies View Related

Changing Values Of Cells Based On Change Of One Cell Value

Jun 3, 2008

I am trying to do is to write a code that will change the values of cells B17:B25 to "false" when the user selects "true" from the drop-down box in cell B16.

Here 's my
Private Sub Worksheet_Change(ByVal Target As Range)

If Target.Address = "B16" Then
If Target.Value = "TRUE" Then
Range("B17:B25").FormulaR1C1 = "FALSE"
End If
End If

End Sub

This is not working! Nothing happens when I select "TRUE" in cell B16!

View 9 Replies View Related

Changing Text In One Cell Creates Formula Change In Column Below?

Apr 1, 2014

I have a list of pricing and I want to be able to change the text of cell, say "D1", which says "Standard" to say "Premium" and all the formulas would change in accordance. The "Standard" pricing would be, Starting D2, "=C2*.3" and I want them all to go to "Premium" pricing which would be formula "=C2*.35".

What would be the best method of creating this function or formula?

View 3 Replies View Related

Stop Formula Changing Cell Reference But Change Sheet Number When Dragged?

Feb 8, 2010

need to do to the below code so that when i drag the formula down it changes the sheet number....sheet1, sheet2, sheet3 and so on but keeps the cell reference the same?

View 4 Replies View Related

Validation Source: Change The List Source

Apr 1, 2009

Not sure if this can be done, still a rookie at this stuff. Everything works but can something be wrote into code too change list source?

View 5 Replies View Related

Paste Single Cell From External Source To Merged Cell In Excel?

Dec 2, 2013

I Want users to be able to copy a reference number from a an external program into excel, this works well for single cells but the cell I want them to be able to paste the information into is a merged cell and keep getting the "Data on the clipboard is not the same size and shape blah blah error". What I can do to get this information to paste? Is there some VBA that can kinda trick the cell to believe its single or when pasting it unmerges and then remerges again?

View 1 Replies View Related

Paste Special Values Of A Formula To A Cell But NOT From A Defined Source Cell

Jul 6, 2008

my destination cells will have formulas like:


='E:My WorkTestData[CCC.xlsx]Input'!$S$31

Everything works fine. But I don't want the destination cells to display the full formula, but the actual Value only

I thought of a way to build a script that first builds the formula to one cell then Copy Paste Special value of that Cell to my desired Cell.

But when the code runs The cursor moves back and forth all the time...

View 9 Replies View Related

Auto Fill Formula Every Nth Cell And Lookup Value Every Nth Cell In Source?

Dec 19, 2013

Source tab contains vital information about some clients.

In the aggregated tab (Cell C10) I created a formula that pulls the Inflows from the source in a very specific array. So for client 1, this works fine. Now, if i copy my formula to the client 2 (Cell C14), it obviously wont go and look in the correct array in my source.

What i need to do is to be able to copy/paste my formula

[Code].....

(from cells C10 to CC10) to cells C14 to CC14, but when copied, the look up array changes to:

Formula: [Code] ....

I will have to fill this formula to at least 100 entries down, so i need to make it work with ease

The good thing is that all look up values in the source increase by a fixed number of rows (12). I tried playing with index/rows formula.. no luck..

Attached File : samplev1.xlsx‎

View 1 Replies View Related

Changing Chart Source With Vba

Jan 31, 2007

I'm trying to create a chart with different source ranges e.g if i used

With ch.Chart
.SeriesCollection.Add _
Source:=Worksheets(1).Source:=Worksheets(1).Range("C1:C8,J1:J8")
End With

That works fine but I want to modify the columns it looks at. I was going to use the cells(x,y) method but I can't get it to work. icol = 3. Range(Cells(1, iCol), Cells(8, iCol)). This works for a single range(C1:C8), but how do i reference Range("C1:C8,J1:J8") in the same way.

View 3 Replies View Related

Chart With Changing Source Data

Aug 11, 2006

I am trying to create a macro which will allow me to change the source data for a particular chart. what i want to do is to have a code which looks in a range of cells (A8:B28) and then updates the chart to only include those cells within the range that contain a value? The number of cells with values changes depending on what options are selected elsewhere in the spreadsheet.

View 2 Replies View Related

Changing Formula Data Source

Oct 16, 2006

I've a set of excel sheets reading from a single excel data source, the only problem is that the data source is constantly changing, for example:

=DCOUNT('T:GreenbeltProductivity ToolWeek 42[Dept Overall and Data Entry.xls]Insert Data - Current Position'!A:F,5,AC139:AD140)

The week number is the only bit of the code that needs to change week on week, to update the data source on all the sheets and I'd like to password protect the data source.

View 5 Replies View Related

Changing A Chart Source Sheet

Feb 9, 2007

I have a sheet ( Graphs A) with 50+ graphs on all linked to a datasheet (Data A).

I now want to copy these graphs to another sheet (Graphs B) which links to a different data sheet (Data B). The data is in the same layout format etc.

The problem is that the find-replace function will not replace the sheet name in the charts series formula from Data A to Data B

Is there an easy way to change the source sheet for the new graphs?

View 3 Replies View Related

Changing Cell Color Based On Changing Values

Sep 16, 2009

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.

View 2 Replies View Related

Can't Reconnect Slicers After Changing Data Source

Feb 11, 2014

I have a workbook with some pivot tables connected to a single slicer. My macro needs to disconnect the pivots from the slicer, change the data source, and reconnect the slicer. When my code gets to reconnecting the slicer it bugs out as if the data source is not the same for all the pivot tables (also doesn't let me reconnect manually). But when I look at the source, it is all the same and correct. If I manually set the data source the slicer reconnects just fine. Why is my code causing problems with the slicer?

Here is my code for setting the data source. Pretty sure this is the code that is causing problems for me.

Code:
newaddress = "$B:$" & Mid(Cells(1, YTDcolumn).Address(), 2, 2)
.PivotTables("PivotTable1").ChangePivotCache ActiveWorkbook. _
PivotCaches.Create(SourceType:=xlDatabase, SourceData:="TOP250Excel!" & newaddress, _
Version:=xlPivotTableVersion14)

Here is my code for reconnecting the slicer connections.

Code:
ActiveWorkbook.SlicerCaches("Slicer_Top250Excel_cypheren_Query_Name"). _
PivotTables.AddPivotTable (.PivotTables("PivotTable1"))

View 1 Replies View Related

Changing Source Data Of An Existing PivotTable

Jun 2, 2008

I'm trying to change the source data of an existing PivotTable so that it is linked to a raw data source in another workbook. The workbook it pulls the data from changes every month so I made this flexible code that is meant to pull the raw data every month:

Sub ImportNewSource()
Dim Filt As String
Dim FilterIndex As Integer
Dim Title As String
Dim FilePath As Variant
Dim ThisPivot As PivotTable
Dim FileName As String
Dim ShtNum As Integer
Dim LastRow As Long

The PivotTable field name is not valid. To create a PivotTable report, you must use data that is organized as a list with labeled columns. If you are changing the name of a PivotTable field, you must type a new name for the field.

When I do it manually, it works just fine. There aren't any changes to the PivotTable field or anything like that so I'm stumped. I've tested the range that has the source data and its selecting the proper range and when I do it manually it works fine.

View 9 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

Index Match - Formula Changing If Source Range Modified

Apr 24, 2014

I am trying to monitor the status of a cell on another sheet and autopopulate a cell depending on that information. The formula works well until I give the spreadsheet to a 3rd party and the formula ranges change after they paste new data to the source sheet. I have tried locking and password the formula cells but they change range regardless!

Here is the formula from the first cell.

[Code] ......

It scans for a number in an adjacent cell. If the number is present on the sheet 'Test', it autopopulates the cell with a string from the source sheet. The cell remains blank until there is data present.

If I cut data from row 6 and paste it to row 17, the formula cahnges itself to:

[Code] ........

How I can lock down this formula so that the ranges remain the same i.e. $AT$6:$AT$26, despite changes on the source sheet? I have tried F4 to toggle relative and absolute references and this has made no difference.

View 4 Replies View Related

Changing Labelcolor In Chart Based On Source Text Color

Mar 5, 2013

I have data. 2 columns a2:b5

each row has a different font color

apple 4
banana 3
peach 2
pear 1

I want the label in a chart to march the font color of the source cell

So in a chart I'd have 4 labels:
"apple"
"banana"
"peach"
"pear"

I can't see how to do it. When i select the albels it's "all or none". I can change ll the labels to a color. But, I want each individual label to be a diferent color.

View 3 Replies View Related

Changing Chart Source Data Based On Running Date

Apr 4, 2007

I currently have a simply bar chart that is based on a running 5 days figure so the X-axis is like 01-Mar 02-Mar 03-Mar ...

Y-Axis is the data that I am trying to present - Total $

The source of this data is simply two columns - Column A is the running date, Column B will be data.

Daily I need to only present 5 days historical data based on the latest date i.e. today and the past four days (the source data is updated daily).

Can a macro be used to auto update the bar charts based on today's date?

View 9 Replies View Related

Find Last Cell In Range, And Changing Another Cell Based On Offset Text

May 4, 2009

If i have a range say E12:O12 and want to find the last cell before blank, lets say it finds m12 as the cell with the value before blank. then with m12 it needs to determine weather row 11 in the same column has Text either "S" or "F" if "S" then m12 = t if "F" then m12 offset(1,-1) = t. And just to make things more difficult i need the range E12:O12 to step 2 as well until it gets to E208:O208 .Noting that row 11 never changes and will always have either an "S" Or an "F"

and also t = time()

View 7 Replies View Related

Excel 2010 :: Changing Cell Color And Border By Clicking A Cell

Apr 25, 2014

I would like to accomplish 2 things in my Excel 2010 spreadsheet by click a cell which already has a number and formatting in it.

1. How do I change the color of the cell, the color of the number in it, and the border around it. (Make it look like I just pressed a button by clicking it.)

2. At the same time have the text in different cell and the number in the selected cell appear in another different cell. (Text in a different cell = A , and the number in the selected cell = 23, the value in the resulting cell be "A 23") Everything I would like to happen at the same time by clicking the selected cell. I would also like this to be done several times by clicking different cells and not changing the previously selected cells.

View 1 Replies View Related

Changing Cell Background Color In Another Sheet Based On Cell Value

Jun 13, 2013

I am working on a workbook with 200+ sheets and an index linking to each of the sheets. On the sheets there is a cell containing the results of calculations and I need the cell referencing the sheet in the index to change background colors depending if the calculations value is greater or less than 0. I currently have working code that also changes the tab color of each sheet depending on the value, but i am trying to add the index cell background change functionality into that. also, the index listings is subject to change. my working code is

VB:

Private Sub Worksheet_Change(ByVal Target As Range)
If Range("d34").Value < 0 Then
Me.Tab.ColorIndex = 3
ElseIf Range("D34").Value > 0 Then
Me.Tab.ColorIndex = 4
Else

[Code]...

and the code i am trying to get working is

VB:

Private Sub Worksheet_Change(ByVal Target As Range)
Dim rngX As Range
Set myRange = Worksheets("Index").Range("A1:A500").Find(Range("C2").Text, lookat:=xlPart)
' the C2 is the reference the title that would be on the index
If Range("d40").Value < 0 Then

[Code]....

I keep getting the runtime error '1004: application-defined error or object-defined error the thing is, i ran the cell background changing code in a normal macro before integrating it in my other worksheet code first and it worked fine. I have a little code experience, though not much in vba and I am unsure what the issue is. if there is another better way to accomplish what I'm tring to do, that would also be fine.

View 4 Replies View Related

Removing Or Changing Data In A Cell By Inputting Date In Another Cell

Aug 4, 2014

cell a1 has yes cell b1 has yes and i want to type yes in c1 that will change a1 and b1 automatically to a blank cell

View 3 Replies View Related

Changing Empty Cell Background Color Depending On Different Cell Value

Aug 7, 2014

I'm trying to create a tag with a color border. What I desire is to fill the BLANK cells around the tag, A1:D1 + D1:D19 + A1:D19 + A1:19 in a certain color based on the text value of the cell B11. There are 5 different values, such that if the B11 read Red Sox - the boarder is going to be red, if it reads Houston Astros it will be dark blue, etc..

I have a similar problem with changing the color of the cell based on the month. So regardless of the year, 2014, 2015, 2016, etc... If I use MONTH() function I can just get numbers from 1-12. I want Cell C16-C18 to be certain color depending the date entered in cell C17 such that for each quarter, months 1-3, 4-6, 7-9, 10-12 they are different color.

I have had no luck with conditional formatting (and I also believe that it is good up to 3 cases only). I am decent in logic/programming language but have little knowledge with macro notation and especially how to run them in excel 2013. I do know how to start it alt+F11 and that I need to make sure that code is written under the specific sheet where my tag is located.

View 6 Replies View Related

Macro: Changing Cell Color Based On Date In Cell

Jan 12, 2009

I did a search on this site and found some code I was looking for (see link:

http://www.excelforum.com/excel-prog...e-in-cell.html - Leith Ross's response code).

The code works perfectly, however, if I save the workbook with a different spreadsheet on top than the spreadsheet referred to in this code, I get an error message: Method 'Range' of object '_Worksheet' failed.

I should state that I did change "Private Sub Workbook_Open()" to "Private Sub Auto_Open()".

I assume I need to modify the code but am unsure as to how.

View 11 Replies View Related

Excel 2010 :: Add Comment To Cell Without Changing Cell's Contents?

Mar 13, 2012

How, via VBA, would I add a comment from a userform (text box name: txtReason) into a cell that may already have a comment in it? I would like to keep the comment that is in the cell and then have the program add a "/" and the next comment from txtReason..

(using excel 2010)

View 2 Replies View Related







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