Substituting Text In A Cell For A Worksheet Name In A Formula
Feb 18, 2010
The content of cell "animal!A1" will change according to a simple vlookup table. Let's say the value can be "dog", "cat", or "horse". In cell "animal!A5", I want to duplicate the content either "dog!A5", "cat!A5", or "horse!A5", depending on the current value of "animal!A1".
I've tried to do a simple reference like:
="A1"!A5
or
=A1!A5
wanting the A1 to actually read either dog, cat, or horse so the reference would refer to the worksheet of the same names. This doesn't work, so I need to know if there is a way to do this.
telephone codes in SA begin with the international code of 27 which when followed by a mobile number drops the zero from the Mobile numbers. eg 27722732415 without the SA code should be 0722732415. i want to remove the 27 and substitute it with a 0 ONLY if it occurs at the beginning of the number and not when it occurs in elsewhere within the telephone number
I need a way to convert the AA1,AA2,etc. in column B1 to the names they represent, when I paste my report in. The values in B1 vary each time the report is ran and there are 2 values for each name so I need it to always resolve to the right name.If anybody has any ideas,like a macro or formula,
And on a different sheet in the same workbook, have 45 different values to be converted:
What is required?
Knowing that using a VLOOKUP function, i can compare a value in the first cell to the list and return the desired value, i need to substitute the strings of characters with those the the list of 45 values so that i can proceed with my work.
Basically, for the 1st Cell for eg..
2232-2232-
I will need a formula to replace "2232-" by the value which a VLOOKUP function will give when comparing to the list of 45.
Result shall look like below:
20-20-
Looks simple when have the same set of characters in the cell, but for a cell which has multiple sets:
2210-22G1-45R1-45G1-20R1-20GP- It becomes difficult for me. What i need exactly is:
Formula to substitute using the vlookup function so that it performs a lookup of the value in the specified cell with the list of 45 values and returns the value (20- or 40-) to be substituted in the cell. What i need finally is a set of 20- & 40- replacing the sets of present data.
I have put together an excel sheet for how how long a part is on a particular machine. If there are multiple operations on a machine, I separated the operation times with a comma in the cell. I am now trying to get a sum of the total time the part is in a machine. I cannot just use a sum since the commas change the format from number to text. I was hoping I could do a substitution where I change the commas to plus signs and stick an equal sign in front of it and somehow get it to be recognized as a formula instead of a text string. Even then, I would still have to do a sum for the entire row. This is what I have as an example
_______Machine 1______Machine 2______Machine 3_______Machine 4_______Machine 5________Total Time Part 1 _____20________ 10, 10, 10_________________________________________________________50 Part 2 ____15 ____________30____________________________10_______________________________55 Part 3_______________________________5, 15, 60, 10________________________5________________95
I need a column for summing the row of times (Machine Time). It doesn't need to be a one-cell solution. If I need to add a sheet to the file to do operations on the data that is fine. Again, I do not want to use VBA code. I already have a solution in VBA and am trying to do it in the worksheet only. I can get a substitution working to get a single cell into a format like 10+10+10, but that's the easy part of the battle.
I have the following code in another workbook that is used to populate a cell on the same sheet based on input to cells in column 'A'.
Is it possible to modify this for the attached workbook to select a cell with data (numbers) on the Input Data sheet in column 'E', add text to the beginning, ('CG' in this case), and paste the result to the Import Template in the corresponding cell of column 'A'? I currently have a formula copied to dozens of cells in 'A' but since the number of rows for the Input Template is variable, there are usually cells in 'A' that contain CG but no corresponding data in the rest of the row.
I have a situation where I have to curve fit data, this can lead to different formulas being used with varying constants.
Is it possible to pickup a TEXT based formula and related constants from other cells, and then place this into another cell as a functioning formula. For Example
Cell A1 contains the formula as a text string whether it be y=a+bx+cx^2, or y=a+b/x, etc Cells A2:A6 contain the individual constants, a, b, c, etc
I would then want the VBA to read the text based formula and put it into an output cell as a functioning excel formulae.g
In cell B10: =a+b*A10+c*A10^2
I understand picking the constants up and putting the formula should not be too much of an issue, however trying to insert the variable form of the curve fit is the part that I am struggling with, and am unsure if possible.
Where 'B2'! is the worksheet I want to lookup. If cell B2 contained BAZ, the index would lookup worksheet BAZ. If B2 contained TAZ, the index would lookup worksheet TAZ.
How can I use (with or without macro) cell text to refer to different worksheets inside a formula. For example I've formula =INDEX(Mary!B9:E17...) but I wanted to write that 'Mary' or whatever sheet name to a cell in one sheet and sheet refenrence in this index-formula would change accordingly.
I have seen a few examples which find the last used cell... but these seem to grab cells that have formulas in them, even though no text has been entered. I need to know how to find the last cell in a worksheet that contains text.
I would like to copy a formula in a cell and then paste only the text of the formula, but I can't figure it out. Basically, I would like to avoid going into the cells and absolute referencing or hitting F2, then copying the text.
When I hit "Ctrl C" to copy the cell, then hit "Alt/E/S/F/Enter" to paste the formula, it is just like a regular copy/paste formula-wise in that the references move.
I'm using a command button (p1) within Private Sub P1_Click()
It pulls the activecell as a string (for example $A$1) using a variable called CurrCell, I then want to search this string (currCell) within the worksheet "DATA" and select the cell 3 to the right of it, so that I can change the value.
I need to cycle and extract row data from the A, B and D columns and copy it into another worksheet while maintaining the copied data structure. Right now I am manually selecting the data....
setting up a worksheet that forces a link to another worksheet when text is entered.
For instance, I will have several columns in the first worksheet (Sheet 1). For each entry, a tally ("X") will be added under the applicable columns. Most of the column headings are pretty straightforward. To keep things uncluttered, I want one of the columns to have an auto-link (?) feature so that when the user adds an X in this one column (we'll call it Column D), the user will then be auto-linked to another worksheet (Sheet 2) in the workbook. Sheet 2 will have room for more information regarding Column D, Sheet 1.
I would like to make a macro that will move rows from one worksheet to another worksheet.
I have an excel spreadsheet with multiple columns and rows, within one of the columns there is some text that refers to SOS or County, I need to move everything that has SOS to another worksheet title UCC SOS and everything that has county to be moved to another worksheet title UCC County. Here is a sampling of the worksheet
The workbook has multiple sheets, and a cover sheet. Each project has a sheet and the status, costs, updates ect. are updated to the cover sheet.
Problem: What happens is there is a cell which has conditional formatting on it, e.g. If text is Green then colour cell green, if cell text is amber then colour amber and if cell text is Red then colour Red. This works fine.
If the cell text is green then I need a number of rows hidden, if it is amber or red then show the rows.
I have found the following Sub If Target.Value = 1 Then Rows(Target.Row).RowHeight=0 Else End If End Sub
Which I have changed to:
Sub If F4.Value = Green Then Rows("5,6,7,8,9,10.Row).RowHeight=0 Else End If End Sub
So this does not work, need to know why and how to make this work for each sheet I am on e.g. ActiveWorksheet?
This is probably far easier then I am making it but I need to take the information that is in a textbox created through the control toolbox and copy and paste that information into a cell on different tab in the workbook. I have tried the infamous google and haven't been able to find much. The excel books that I have don't really touch on the control toolbox functions.
I have a formula to extract the worksheet name and add the "!" to it so it can be used in a copied formula... I'm just having trouble writing the formula to reference the text in the cell with the worksheet name. If it's easier, I also have the list of worksheets without the "!" - e.g., Sheet1, Sheet2, Sheet3, etc...
I want the formula to calculate, in my example, the sum of 2 cells on a different worksheet.
I am trying to use the Indirect function to use the value in a cell to select a sheet with the same name as the value of said cell. I have looked at several posts and attempted multiple methods. I still get an error. I cannot find a thread describing exactly what I am trying to do, which is:
reference a cell value to direct the formula to the correct sheet to then complete an array Sumproduct formula.
Since this description barely makes sense to me reading it, I have attached an example. The problem is in cell C7. Basically, I want cell c7 to look at cell c1 and then go to the tab with the matching name as cell c1 and complete the calcuation.
One of my macros is a tied to a worksheet_change. The macro runs and gives me the result that i want, however excel flips to the sheet that the sub is running for.
example:
Sheet1, Change the cell excel flips the visible to sheet2 macro runs
Its kinda of annoying. I would like excel to stay on sheet1 where i am trying to finish data entry. I suspect it is how i have writen the macro. Any help at all on how to clean it up.. or a better way to write the same thing would be very appreciated.
Sub TermPlacement()
' Term_Placement Macro ' Uses the Value of Term to insert a formula repeatedly in a colum.
Dim sNFormula As String Dim rTerm As Range Dim rStart_Cell As Range Dim rNpayment As Range
'The reference cell located directly above the first cell in column Set rStart_Cell = Worksheets("Floor Plan").Range("$B$13") 'Additional set values....................
Is it possible to link a cell e.g. A10 that has a time value in it (there is a formula in this cell that puts in the time value) to another cell in a range of cells e.g. B1:B1000 that has the same time value?
The formula in cell A1 of the attached inserts the worksheet name, but it doesn't work when pasted to a group of worksheets. The formula doesn't change from sheet to sheet, yet the results refer to the workheet name where the "paste" was originally done. Does anyone know of a similar formula that would work right when applied once across a group of worksheets?
I paste new data into a sheet of a monthly report I prepare. For this sheet, the # of data rows change (and is unpredictable) every month. I need the value inside a specific cell that dynamcially moves up and down based on the # of rows for that month (because it's below the rows of data).
So I made a formula to identify the exact cell # every month.
Example:
This month the exact cell is F255 in the "Refi" sheet.
So my formula in the "Summary" sheet cell A1 first finds the cell row # only (255) and since it's always column F, in B1 I have
VB: ="F" & (A1)
This outputs "F255" in B1, successfully identifying the target cell.
Now how do I write a formula in C1 to grab the value from whatever cell is named in B1. (For this month, the value in cell F255 from the "Refi" sheet)
I have a list of headings and items and I have a set of formulas that work out depending on the heading what items are listed.
Say theres 10 items and the heading starts at C4 and that heading has 10 items, so it puts "C5" as text in G1 and "C15" as text in G2 so i now know my cell range of items
How can i use the text in those cells to put in a formula to call that as a range?
If I use the indirect formula it shows me the value of the cell, but im after using it to reference the cell