Find And Replace Part Of Another Formula With Value Of Cell
Jun 26, 2012
I have a formula in cell J2:
I need a macro that will change the part of the formula that is "CI10001G" to the value of cell A2 which would basically be something along the lines of "CI10004D" so the formula would change to the following:
And then this formula will then successfully look in the newly directly file path.
As part of a macro i do a find and replace on a range cells that replaces "/1" with nothing (""). Therefore 2/1 becomes 2, what i don't want though is if the de-nominator includes a 1 but not only 1 to keep the whole of the de-nominator, say 8/11 does not want to become 8/1.
I'm trying to 'find and replace' part of a filepath which is buried in hundreds of formula, but when I hit 'Replace All' a file navigation window appears. Hitting cancel simply bring up another window, and again and again, each time a replace is executed.
I have a work problem where my spreadsheets have the following structure due to faulty optical character recognition:
Ringholm 8 G R hem.ag Bavik Postl 115 O Amtervik Rinman K H B dir Johannebergsg 34 Goteborg S Risberg L kass Mitandersfors Bogen
In some cases the letters in the beginning of the cells have been misread as a number (above S as 8), so I want to search and replace those numbers with the correct letter without changing the correct numbers at the end of the cells to letters too. Is there any way to write a search-and-replace code in VBA that will only implement the search-and-replace in (for example) the first five letter-spaces of the cell?
I am wanting to replace part of a cell ( the first two digits) with nothing - blank
eg cell contains 441298871657 and i want it to read 1298871657 I am looking for a function to do this, i have tried using the finf and replace function but if 44 appears somewhere else in the value this will also be replaced.
I am trying to create a macro where it finds a a certain word in a column for example C. What i want it to do is find anything that says FWD_EUR and then replace that cell (e.g C2) with CASH_EUR_FWD and after it has done that it replaces the adjacent cell (e.g. D2) with EUR_FWD. I then want this to do the same with FWD_USD to CASH_USD_FWD and adjacent cell to USD_FWD.
I have text in column 1 and need a formula that will replace it with text in column 2, as shown in (fig 2).
FIG 112X Jan 2009 7.5000 put X Jan 2010 5.0000 callAA Jan 2010 17.5000 call AA Jan 2009 9.0000 putIBM Jan 2010 130.0000 call IBM Jan 2009 17.5000 put PLCE Jan 2009 30.0000 call PLCE Feb 2010 7.5000 put
FIG 212X Jan 2009 7.5000 put X Jan 09 7.50 putX Jan 2010 5.0000 callX Jan 10 5 callAA Jan 2010 17.5000 call AA Jan 10 17.50 call AA Jan 2009 9.0000 putAA Jan 09 9 putIBM Jan 2010 130.0000 call IBM Jan 10 130 call IBM Jan 2009 17.5000 put IBM Jan 09 17.50 putPLCE Jan 2009 30.0000 call PLCE Jan 09 30 call PLCE Feb 2010 7.5000 putPLCE Feb 10 7.50 put
I basically want to find and replace certain characters in a formula, but the formula is quite intricate so I will give some background to the problem first:
I have a complex spread sheet which is used to check if a data array matches another data array (both data arrays are different sizes). One array has a set of parameters for a variable and the other array has the variables and the actual values for each variable. I have a section with the following formulas to check if the actual value (C121&D121) matches the parameters ($A$9:$A$108, $B$9:$B$108) & ($C$9:$C$108, $D$9:$D$108)
I have the following formula in cell AB121: =(C121=INDEX($B$9:$B$108,ROW(101:101)-INT(ROW(100:100)/$D$1)*$D$1))
In cell AC121: =(D121=INDEX($D$9:$D$108,ROW(101:101)-INT(ROW(100:100)/$D$1)*$D$1))
And have similar formulas from AD121 to AY121. I mention this to point out that excel regards this as an inconsistent formula, I haven't copied and pasted it over, I have had to re-enter it in each cell adjusting the parameter sections.
The problem I have is that currently this is set up to check through a data set and wrap around every 100 rows ('100' Entered in $D$1) but I want to adjust the formula when there is a different amount of rows to check. So basically the only way I can think to be able to do this is to have a formula or something in VBA (which I have very low level experience with) to be able to go into the formula and change certain characters within the formula. For example, if I wanted to check 95 rows instead of 100, it would need to have 95 in $D$1, which I enter in manually, but then how to go in and replace (101:101)-INT(ROW(100:100) with (96:96)-INT(ROW(95:95) in 2 sections in the 1 formula then do the same with the inconsistent formula from AC121:AY121?
I'm receiving this message when I attempt to use the Find, Replace function. Formula is too long". I have a column of cells containing text only. ( about 2-3 paragraphs worth) I'm trying to replace a name with another name, which works fine where the cell contains a single or few sentences, but fails to replace when the cell contains too much information.
I've got a code that does what I want it to do, but I have to select the start point manually becuase it's position varies on different documents. It's usually around row 650 out of 1200, but the cell I want to start the macro at always contains the word ELECTRONIC. What I would like to do is modify my code so that it finds that cell itself and then runs the rest of the code. I'm not very good with VBA, but I've tried a few things like Dim LR-2 and using that but I get error messages about duplicates.
Here's my code
HTML Sub Macro1() ' ' Macro1 Macro ' SALES ORDER FORMAT ' '
This problem has come up fairly frequently lately, and I'm not sure how to fix it, or if this is by design...but in Excel 2003 I can't seem to do a "Find and Replace" based on the value of a cell. I can do a find, based on cell value, but the moment I change to the replace tab, the "values" and "comments" are missing from the "look in" dropdown.
I've only noticed this when I'm trying to replace on a filtered list, so I'm not sure if that is part of the issue.
Perhaps an alternative way of arriving at the same goal. Basically I have a worksheet with a number of filtered columns. They are filtered just right, using custom filtering, and so I do not want to undo the filters. In some columns I have formulas that are returning #VALUE! errors. I'd like to replace all of these cells with NA.
I am working with a lot of data and have been making a table of statistical analysis for several rock types. I have it worked out to where i can filter the data and with the use of a bunch of IF functions, below, and it keeps everything the way I want.
The problem is I have to introduce new rock types, but if I just copy the formulas over i then have to go through hundreds of cells and switch sedimentary rocks to volcanic or whatever new class i have.
How this can be done faster. Maybe some way to say "find "text" within this range and replace" i can do it for actual values but when its embedded in a function im not sure.