Formula To Reference A Specific Variable Cell

Jan 13, 2009

Not been around for some time now but have to do my annual update for this workbook and implement some new changes.

In the attached example workbook, I have created some formulas which reference a particular cell for each client e.g.

View 2 Replies


ADVERTISEMENT

Reference Specific Cell As Variable?

Feb 22, 2012

I have a spread sheet that lists a bunch of dates and expected volume that will be associated with the date. I need to build a macro that will look at the first date expand it out for several months then look at the volume and break that out over a week's time.

That part is simple enough but I need to turn this into a looping statement and I cannot figure out a way to get my macro to always come back to the next date in my list.

Ideally I would like something that is a variable that references the cell I want so I can do something like this.

Code:
MYRANGE = range("B2")
Do
range(MYRANGE).select

[Code]....

This should work for me perfectly if I can just figure out how to make the MYDATE varaible reference a sepecific cell rather than a value or text in the cell.

View 2 Replies View Related

Using Variable As Cell Reference In Formula

Jul 15, 2014

I'm trying to use a variable as a cell reference in a formula using '&', but can't seem to get it to work. I've looked through the forum, which have examples of how to do this using a range, but not just as a single cell reference. This puts the formula '=VLOOKUP("A & lastrow &"" , Vlookupinput, 2,0)", which obviously gives me an error.

My code is:

Code:
Dim lastrow As String
lastrow = Range("A" & Rows.Count).End(xlUp).Row + 1

ActiveSheet.Range("A" & Rows.Count).End(xlUp).Offset(1, 1).Select
ActiveCell.Formula = "=VLOOKUP("A & lastrow &"" , Vlookupinput, 2,0)"

View 5 Replies View Related

Variable Cell Reference In INDIRECT Formula

Sep 28, 2006

I want to create a formula of the form: =INDIRECT(ADDRESS(4,2,2,TRUE,($A9) and insert this in a cell BUT the $A9 reference needs to reference the row of the cell where the formula is being inserted which will vary. ie. A30, A31, etc. How do I do this?

View 2 Replies View Related

Variable Cell Row Reference In Formula/Function

May 17, 2008

I will show with an example of what I would like to do. I italized and underscored the part of the formula.

---A----B
1 24 formulaB

formulaB = "= CELL("contents",DifferentSheet!G(A1))"

I want B1 to contain the value from the cell G24 in sheet "DifferentSheet". I want to use the value in A1 to determine what row on "DifferentSheet" I should use.

View 2 Replies View Related

Copy Relative Formula & Use Row Reference From Variable

Mar 5, 2008

I have the following code which Clears the content of a cell. The next thing I want to have happen is to have another cell equal a formula but make that formula relative to its place. The formula is the following =IF(ISERROR(VLOOKUP(F56,Routes_All,2,0)),0,VLOOKUP(F56,Routes_All,2,0))

I am not sure how to paste it where the row changes depending on where it is pasted. Here is the code that does not work...

Private Sub CommandButton1_Click()
Worksheets("2008 Log").Select
Dim cRow
cRow = ActiveCell.Row '

Cells(cRow, Range("Column_Type_Of_Ride").Column).ClearContents

Cells(cRow, Range("column_duration").Column).value = "=IF(ISERROR(VLOOKUP(F56,Routes_All,2,0)),0,VLOOKUP(F56,Routes_All,2,0))"
End Sub

As you can see, no matter where I paste it it will always refer to row "F". How can I have it refer to row "cRow"?

View 2 Replies View Related

Variable Reference In GetPivotData Function/Formula

May 28, 2008

I am trying to do a "getpivotdata" formula on a cell in certain file that gets info from a pivot table on another file. However the name of the second file (the one where the pivot table is found on) might be different each time so I created a variable for the second file name but I can’t figure out a way to use this variable in the get pivot data formula as I am not very experience with VBA.

Template = Application.InputBox("What is the name of the file ending with (.xls)")
If Template = False Then
cont1 = MsgBox("Please write the name correctly using (.xls)!", vbOKOnly)
If cont1 = vbOK Then
Exit Sub
End If
End If

View 3 Replies View Related

Formula Needed Based On 2 Conditions And Variable Row Reference

Jan 9, 2014

I am an architect and recently I was required to do some extensive calculation relating to water requirements and toilet requirements for a building that i was designing. i created a excel file, with a basic vlookup function to put certain values in the cells that are pre-defined for a particular building typology (mostly created by governmental bodies as guidelines). for example, when i choose a particular type in column E, column F and G fills up automatically. now this table also gives me occupant load based on what is the area i enter in column D.

The problem is that I want to automate the calculation of toilet requirements. Now, each typology will have a different formula to calculate WC/Urinal/washbasin.

1. there will be 17 different formula - one for each typology (as shown in sheet 5)
2. Column j will calculate what is the number of WC required based on 2 criteria - first id what is the typology and then looking what is the number of occupant.

The problem here is for example, if in E9, selected typology as "offices", the formula of offices typology will be used in J9 and occupant value from H9 will be used but if i have E18 also selected as offices typology, the same formula will use occupant value mentioned in H18 instead of using H9.

Hence, excel will first have to look what is the typology selected. based on that, it will load formula - out of that 17 different formula - specific to that typology and finally it will refer to corresponding row for occupant load and will use it in the formula to get the result.

View 3 Replies View Related

Variable In Cell Reference

Apr 11, 2007

I have counted the number of rows using i. Now I need to pass that variable to the ActiveCell referances shown.

Do While Not Selection. Offset(i, -6) = ""
ActiveCell.FormulaR1C1 = "= round(R[i]C[-8],2)&""±""&round(R[i]C[-7],2)"
ActiveCell.Offset(0, 1) = "=round(R[i]C[-7],2)&""±""&round(R[i]C[-6],2)"
ActiveCell.Offset(1, 0).Select
Loop
End Sub

View 9 Replies View Related

Use A Cell/variable As A Sheet Reference?

Jan 10, 2010

I have a formula that pulls data from another sheet using standard reference of sheetname! I want to build this forumla to use several sheets, and would like to pull the sheet names from other cells.

For example... instead of LEMONS!a1 and LIMES!B2

I would like to use REF1!a1 and REF2!B2

where REF1 and REF2 are pulled from cell Z1 which contains test 'Lemons' and cell Z2 which contains text 'Limes'

How can I do this?

View 9 Replies View Related

Sum Across Sheets With Variable Cell Reference

Jul 9, 2008

i'm trying to use the sum across sheet function - i.e. - =SUM(Start:End!B1)
Whereby "Start" and "End" are the two relevant sheet names and "B1" is the cell I want added up.

However, can I make B1 variable, whereby there is a cell, say in A1, that contains the string "B1", so that I can make it sum C1 or B20 or anything on the other sheets?

View 9 Replies View Related

Circular Reference: Cell References In The Formula Refer To The Formula's Result, Creating A Circular Reference

Aug 14, 2006

I have the following formula in cell L51 of all sheets calculating the volume depending on the monthly index that is chosen from the drop down menu in a particular sheet. =If(MIndex=0, SUM(D33:L50),If(MIndex=1,SUM(D34:L50),If(MIndex=2,SUM(D35:L50), 0))). I am getting the following message and I do not understand what it is about.

Microsoft Office Excel cannot calculate a formula. Cell references in the formula refer to the formula's result, creating a circular reference. Try one of the following

View 3 Replies View Related

Variable Cell Relation / Reference In Macro

May 29, 2012

I am building an Excel sheet for my company which keeps track of who has done what with a new client in a step by step process. I have it set up so that once a department clicks complete in a box it automatically emails (VIA a macro) the next person who needs to do the next task. Some tasks are done by the same person no matter what, other tasks are done by a project leader which is different depending on the client.

The problem I'm having is that, within the macro, I need to reference an email address in a cell X cells to the left in the ".TO" line.

So, in Column A I have the CLIENT, Column B The PROJECT LEADER, and Column C The PROJECT LEADERS EMAIL. Then the next 22 Columns are labeled steps with drop down boxes, once the have selected "COMPLETED" it triggers the macro and send the email, just not on the ones when it needs to email the PROJECT LEADER, since it's a variable. Below is the macro, how I can have the ".TO" line in the email reference the email address in Column C to the left of it?

Sub Mail_Workbook_1()
Dim OutApp As Object
Dim OutMail As Object

[Code]....

View 2 Replies View Related

Assign External Cell Reference To Variable In VBA?

Jun 29, 2006

I'd like to assign a value located in a cell in a workbook to a variable in a VBA program in another workbook. I do NOT want to open the workbook that contains the cell with the value. I can't get the hang of referencing an external cell reference. Let's say there's a value in a cell named "nbr" in a workbook named "tst.xls" located in a path "c: est" that I want to assign to a variable "tstnbr" in a VBA program, what is the best way to code that?

View 8 Replies View Related

Make Cell Reference Column Variable + Row Absolute?

Jun 18, 2014

I have read meanwhile dozends of articles and comments about absolute and relative cell references.

But I found nowhere an example on how to make a the column part of a cell reference variable and the row absolute.

Is

K$10

a valid expression?

In opposite to $K10 is must work this way

View 3 Replies View Related

Circular Reference - Value Of That Variable Changes Depending On The Location Of The Cell

Mar 16, 2009

Excel 2003 > Attached is a small model of what I am trying to accomplish. Cells B2 and B4 contain the same formula … a formula that calls a simple function. The function has a variable passed to it … and the value of that variable changes depending on the location of the cell. Now, see the function in Module1 … it is called CellCalc. If the variable passed = Jim then value = 3. If the variable passed = Jack then value = 8. That is straightforward.

Note also that when Sheet1 is activated, I calculate the cells from left to right and top to bottom … that is important. Here is the challenge. If B2 > 1 then I want to add B2 to B4 and set B2 to 1. I can set B4 properly but I cannot reset B2. You can see my 2 attempts that are commented out. Is there some way of accomplishing this … or am I simply stuck in a circular reference?

The alternative to this is to write a function that operates externally on these cells. That will work for sure but then the values of the calculations will overwrite the functions in those cells, thereby taking away the dynamic nature of this application.

View 4 Replies View Related

Variable Cell Reference Based On Minimum Difference

Feb 12, 2010

I have a monitoring system that records a data point with a date/time stamp several times a day at random intervals. For each reading I want to calculate the change compared to the first reading that was more than 24 hours ago, which could be anywhere from 1 to 20 rows above the current one. Hence with the timestamp in col A and the value in col B, the formula in col C, for example cell C20, needs to read something like =B20-Bxyz, where xyz is the row number of the first reading that is more than 24 hours, i.e the first row xyz where A20-Axyz >1.

View 4 Replies View Related

Change Formula Cell Reference Based On Another Cell Reference

Jan 8, 2012

How do I change a formula cell reference based on another cell's reference? I'm building a schedule that looks to a task's trigger and adds days based on that relationship. All entries in column "A" will be text and all cells in "B" will be the simple formula "=A2" or "=A3". Due date is calculated by adding the value in "C" to the preceding date in column "D". In the spreadsheet below, the trigger for "Budget set" is "Specs written" with 3 days added to the previous due date.

________A________________B_____________C_________D
1 Task___________Trigger_____________Days_____Due Date
2 Design begins__Proj OK______________10____10-Jan
3 Specs written__Design begins (A2)____5____15-Jan (D2+C3)
4 Budget set_____Specs written (A3)____3____18-Jan (D3+C4)

If the trigger for A4, "Budget set", changed from A3 to A2, is there a way that the formula that determines the due date in D4 could read the trigger cell reference in B4 so that the value in the corresponding row in column "C" is added in the date column?

View 4 Replies View Related

Cell Reference :: Formula To Reference New Cells

Feb 15, 2010

I have lets say 12 months of data. I have formulas that reference the latest 6 months. When I insert a new column to input a new month, how can I make the formulas include the new months without manually updating them.

EXAMPLE:

12 months of data exist in cells B3:M3 going from B3(oldest) to M3(newest). Formulas reference latest 6 months of data in cells H3:M3. When a new month hits, I insert a column after column M.I would like the formulas to now reference cells I3:N3 which is now the newest 6 months.

View 14 Replies View Related

Date Countdown With Reference To Specific Cell?

Jun 25, 2014

I have this formula counting down days until my next fire drill:

[Code].....

However... Every time the drill is done I need to change the date in the formula for the countdown. That I can have it reference a cell instead?

My initial idea was a formula like this:

[Code] .....

(however this code doesn't actually work ...).

View 5 Replies View Related

Auto Generate A Comment Box Based On A Cell Value That Has Variable Reference Cells

Jan 30, 2010

I have been given the following code and it works great. I now need to adapt it to the following scenario: In the attached sheet, the user has to select either, "Suburban" or "Squad" in row 5. If the user selects, "Suburban" I need this script to compare the values they enter in a given row to the value in column "B".
If the user selects, "Squad" I need this script to compare the values they enter in a given row to the value in column "C".

Look at row 48, for example. If the user enters, "Suburban" in cell D5 then the value they enter in cell D48 should equal "1". If it does not equal "1" then it should proceed with the adding of a comment. Conversely, if the user enters, "Squad" in cell D5 then the value the enter in cell D48 should equal "2". If it does not equal "2" then it should proceed with the adding of a comment.

View 5 Replies View Related

Cell Reference Cell Then Append Specific Text Using Vb

May 16, 2009

This is probably really easy but I don't know what I'm doing wrong.

View 2 Replies View Related

Match Cell Reference Rather Than Specific Text Or Value - N/A Error

Dec 7, 2013

I'm getting an N/A error on my MATCH formula.

I'm trying to match a cell reference, rather than a specific text or value.

Here is the syntax I used. MATCH(Cell,Table Array Name, 0)

I have made sure that the text matches exactly and the cell formats are the same.

View 1 Replies View Related

Find Cell Reference Containing Specific Value From Current Position Up

Jan 29, 2009

I'm having some difficulties in defining my formula. I'm pretty sure that this should be possible.
I have a table containing values and dates. For each change in dates, I should summarize every value for that date. I cannot use the autosummarize function, because I do not want the sum to be beneath the values, rather in a column to the right of the values.

I have created a formula which checks for a change in date: =IF(C15=C16;0;1) where the C column contains the dates. Basically I say that the Index column should contain a 0 if the date is the same as previously registered, 1 if it is a new date.

The index column is used in some conditional formatting rules, so I would like to keep it anyway.

View 7 Replies View Related

Copy & Paste Specific Column Based On Cell Reference

May 20, 2008

I've searched for a solution on the board and the internet too but to no avail; I am trying to create a macro that will select the entire column based on a cell reference G1 which is infact a Date.

Column G to Column S are pre-defined with a specific Date in row 8. If the Date in one of these columns (G8 to S8) match with the Date in cell G1, say it finds a match with H8, then I want to copy the range F14:F2000 and paste as values in range H14:H2000. The possibility of a match found is limited to a single columns from G to S.

View 9 Replies View Related

Excel 2007 :: Formula To Return First Cell Reference In Another Cell Formula

Oct 1, 2011

Version: Excel 2007 WinXP

I'm basically looking for something almost like an inverse function to INDIRECT. This function would first look at a cell's formula as a text string, parse out the first valid cell reference in A1 format, and return that cell as a text string.

Detail: I have a spreadsheet with cells that point to other values. I would like to get only the row number from the first cell reference in the formula residing in a given cell. For example:

Suppose A1 has the formula =AL267. and A2 has the formula =SUM(AL94:AL235)

I would like a formula in B1 that returns the text string, "AL267" so that I would know this is the first reference.

Ideally it could be dragged down to B2 such that it returns the text string "AL94" (and not "AL235") because AL94 is the first cell reference in A2's

Currently I am copying the formulas after hitting ctl+` and pasting that text into a text editor, followed by text operations to manipulate the results into the desired values. Any solution that didn't involve going out to notepad.

View 2 Replies View Related

How To Reference A Variable Stored Within Another Variable

Jul 27, 2009

how to achieve what I'll call "parameter driven" code where the "parameters" are variable names.

For example, in the following code... I'm looking for an answer to the question posed...

Sub Test_Sub()
Dim vX, vY, z
vX = 10
vY = "vX"
For z = 1 To 3
'This next line generates a Run-time error... But...
'=====================================
MsgBox z * vY '

View 9 Replies View Related

Specific Cell To Run A Specific Formula

Aug 14, 2009

let say in cell A6 i have a list

SnG
Cash
MTT

I can pick one of these. If i pick Cash then i want a specific cell to run a specific formula. depending on the item chosen.

So in cell A6 is the list.

in cell B6 an amount will be place and in C6 another amount will be place. the number for c6 will range from a -number to a +number.

But D6 looks to see if B6 meet the requirements for MTT, SnG or Cash depending on which item was selected from the list. and uses the formula below with $c$3 changing from to either $D$3 or $F$3 and comparing the values for the chosen item. the formula changes would look this

=IF(ISBLANK(C6),IF(B6>$C$3,"Do Not Play","PLAY"),IF(C6<B6, "Lost","Win"))

=IF(ISBLANK(C6),IF(B6>$D$3,"Do Not Play","PLAY"),IF(C6<B6, "Lost","Win"))

=IF(ISBLANK(C6),IF(B6>$F$3,"Do Not Play","PLAY"),IF(C6<B6, "Lost","Win"))

View 12 Replies View Related

Using DOB Formula As Reference Cell

Jul 28, 2012

I am using the DOB formula of =DATEDIF(AA19,NOW(),"y") & " years, " & DATEDIF(AA19,NOW(),"ym") & " months, " & DATEDIF(AA19,NOW(),"md") & " days". In the next cell I want it to look at the previous cell and determine if "older than 2 years". I have tried the "search" and isnumber, but I keep getting the wrong answer.

View 1 Replies View Related

Formula To Reference A Cell

Jul 26, 2009

Hello,

I am trying to create a formula in Excel to preform a "SUM" on cells that only have a letter Y (as in "yes") in the cell next to them.

For example

View 3 Replies View Related







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