Remove Portions Of Formula Based On Surrounding Characters?
May 13, 2014
I have about 25 workbooks with 180 formulas in them that I would like changed. The formulas are all in the range I10:Q29 and all have the same basic structure:
[Code]....
I would like to remove "filepath1!cell1*filepath1!cell2-" and "filepath1!cell2-" so that only "(filepath2!cell3*filepath2!cell4)/(filepath2!cell4)" remains.
My VBA is pretty weak, but I imagine it should be possible to use something like the VBA equivalent of len() and mid() to isolate the components of the equation to the left of the - in the numerator and denominator, and remove those components (as well as the -) from the formula.
Attached File : trim formulas.xlsx
View 12 Replies
ADVERTISEMENT
Apr 28, 2009
I am looking for a formula that will remove any unwanted characters in a cell.
For example i may a word or string of words with "-" , " ' " or "," in them and i would like to have these removed.
View 2 Replies
View Related
Mar 10, 2009
i need a formula that will remove the first 2 characters and the last character from the below, so below the result should be R0131644, the number of characters vary from row to row, they are not always 11
EUR01316441
View 9 Replies
View Related
Aug 10, 2007
Having the Zip Code Tabulation Module from the US Census Bureau, I have the following and much more. But based on the 3 items :
5-digit Zip Code, Longitude, Latitude.
I'm wanting to Select a Zip Code and have (let's say) several Zip Codes plotted (maybe 4 - 10) out from the center point of the map.
either with, or without a connecting straight line .
And possibly a Scalable Miliage indicator |---- 10 Miles ----| which would be based on the distance.
View 9 Replies
View Related
Aug 8, 2009
I have found a very useful UDF for removing non-alpha characters from strings. (See below, Credit for posting to Stanley D Grom - Ozgrid post Removing Non-alpha Characters From Text).
Option Explicit
Private Function RemoveCharacters(InString As String) As String
Dim intLoopCounter As Integer
Dim intStringLength As Integer
Dim intASCIIVal As Integer
intStringLength = Len(InString)
InString = LCase(InString)
For intLoopCounter = 1 To intStringLength
intASCIIVal = Asc(Mid(InString, intLoopCounter, 1))
If intASCIIVal >= 97 And intASCIIVal <= 122 Then
RemoveCharacters = RemoveCharacters + Mid(InString, intLoopCounter, 1)
End If
Next intLoopCounter
End Function
Two requests:
1. Could the UDF be modified such that any part of a string contained within brackets is also removed (e.g. "NLGA High Street (West-Enfield), EN6" becomes "nlgahighstreeten")?
2. Can an argument be added to the format of the UDF, such that numbers (0 to 9) are either included or excluded (e.g. RemoveCharacters(A1,1) where the argument 1 would include any numbers (0 to 9), so "NLGA2003 High Street (West-Enfield), EN6" becomes "nlga2003highstreeten6")? blankor 0would exclude these numbers, i.e. would return "nlgahighstreeten"
View 5 Replies
View Related
Feb 11, 2014
I have set up a formula to sum data from specific columns in multiple sheets in the same file. The simple formula had worked perfectly until I needed the data from the last sheet. In all of the other sheets the data that I need to pull is all in consecutive rows but in the last sheet the data that I need pulled and added is in every 4th row. The sheet looks like this:
All of the columns I've filled in work fine. The ones blank are the ones I am running into issues with. When I drag down the formulas excel pulls the next consecutive rows, which is perfect for the first four sheets I am summing, but for the fifth sheet (I'll ref the Test1 column) I need it to pull 'Wayne 2014'!C6 and then 'Wayne 2014'!C10 in the next row and so forth.
Date
All Test
Test1
Test2
Test3
Test4
$ Amt.
Jan.16
=SUM(C2+D2+E2+F2)
[Code] ........
The first four sheets look like this, which is why they work fine:
Date
All Test
Test1
Test2
Test3
$ Amt.
Jan. 16
=SUM(C2:E2)
[Code] ........
The fifth sheet looks like this: I only want the formulas from the first sheet to pull the data from the dated rows in this sheet.
Date
All Test
Test1
Test2
Test3
$ Amt.
Jan. 16
=SUM(C2:E2)
=SUM(C3:C5)
[Code] ......
Is there any way in Excel 2010 to get it do what I want? (I am not sure how that one cell became outlined and I do not know how to fix it.)
View 4 Replies
View Related
Jun 5, 2008
let's say row 2 has data that looks like
apple (kg), apple (g), orange (kg), orange (g)
it is possible to remove the (kg) and (g) tags so that it'll become
apple, apple, orange, orange
using VB code?
View 9 Replies
View Related
Apr 27, 2006
May I know how to remove character like
1) full stop
2) spacing
3) Dash
4) Hyphen
5) Left and Right Slash
For example:-
016-2733(LS-800E)
MS12-FS4/2M
1/4"GTR
Output:
0162733LS800E
MS12FS42m
14GTR
View 2 Replies
View Related
Dec 26, 2009
I'm trying to remove everything after a specific character in a string.
I.e. change a website address to the hostname
http://www.excelforum.com/newthread.php
http://usa.excelforum.com/forum/new
to
excelforum.com
usa.excelforum.com
I'm using this formula, which strips the http:// and the www., but does not replace the characters after the first remaining "/" as the wildcard is not recognized.
=SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(A2,"www.",""), A2,"http://",""), A2, "/*", "")
View 11 Replies
View Related
Feb 19, 2008
I have to manually go through about 9,000 workbooks. In cell E43 of a certain sheet called "list" I have to delete underscores(_) and replace them with a single space. and remove the Rev** after each name
In example: company_name_t45671000_RevA2
Will look like this when I'm done: company name t45671000
Now I've tried to make a Macro that will delete the underscores and the Rev which worked fine except that it replaced the names with the the name that the macro was recored under.
IE: The first sheet I done worked fine when I hit the keyboard shortcut command which was company_name_t45671000_RevA2.
The second workbook sheet of "list" got fixed but had the name of the one I fixed before it: company name t45671000, where it should have been "company name s6743245.
Is there a way around this?
Also sometimes the sheets are protected, is there a way to incorporate "unprotect sheet" when it needs to be unprotected and then after the file has been corrected, re-enable protection again?
View 11 Replies
View Related
Mar 6, 2013
I always seem to have trouble with the Find() and MID() function when used together. I try to following the syntax but it keeping erroring...
I'm trying to remove all the characters before the first non-zero number.
e.g. ABC263080 becomes 263080
PROGO0123 becomes 123
View 1 Replies
View Related
Apr 3, 2008
I need to remove the last x characters if its equal to 0's
see:
101190
101200
101300
102000
102010
102020
should be
10119
1012
1013
102
10201
10202
View 9 Replies
View Related
May 26, 2009
i need a macro to do the following,
1. Remove all commas from activeworksheet ( i notice i cant see the commas in excel, but when i open notepad i have commas in empty rows)
2. Remove all characters such as = + # ( ) $ from Column 5
View 9 Replies
View Related
Sep 10, 2009
there is a none VBA way to remove everything from a cell but the numbers.
Example: A, DAVID (002081) becomes 002081
The cell the formula will go in is F4 and the cell its looking at is K4.
View 9 Replies
View Related
Feb 10, 2009
I need to remove the last 2 digits from a cell that maybe different lengths. For example:
PL26 7QS
ST20 0AW
LE4 8LF
PE30 3WH
CF31 3AY
View 3 Replies
View Related
Jul 21, 2006
The numerical results in column A need to have the last three characters stripped from the cells. I used the =LEFT formula in adjacent cells to return the results but I am looking for a way to run code to remove these three numbers in each cell from row 1 to 8000 in column A.
View 2 Replies
View Related
Nov 9, 2006
i want to convert an excel spreadsheet into a text file, keeping the same format, but when i do so, excel puts " " around the characters, which i don't want. Example: please see the 2 attachments.
e.g. when i convert, i don't want the " " around the commas in the text file.
View 6 Replies
View Related
Nov 16, 2006
I have a string like: AAJDGYE030000460. How can I remove the first character in a macro? I need to look at the second,third, and forth character
View 3 Replies
View Related
Dec 21, 2006
I have a set of data in column a that consists of email addresses. These email addresses all have underscores after them, ie "abc@hotmail.com_______". It will be a different amount of underscores everytime and I don't want underscores to be removed that are actually part of the address. I had been using the find replace function through vba, ie
Range("A:A").Select
Selection.Replace What:="_", Replacement:="", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
however this ofcourse removes from actual parts of the email address. Is there a way to do this?
View 6 Replies
View Related
Oct 16, 2007
The macro I have select 2 columns and 2000 rows. I need a VBA code that will loop through each of these 4000 cells and remove all characters (replace them with blanks) that are not a number, a period or a decimal. Characters from other languages like Chinese, Japanese and Russian should also be removed.
View 3 Replies
View Related
Oct 25, 2007
I am trying to reformat the following data: 10-10-14-1W5 needs to look like this 100101001401W500. The full description is actually 100/10-10-014-01W500 the desired result is without the slashes and dashes. I have tried to add a custom cell format of 00-00-000-00L000. but it will not apply to the existing data.
View 5 Replies
View Related
Jan 22, 2008
I've come across multiple times where I have to do this same sort of task, and I don't think I am doing it the most efficient way.
What I need to do is take a variable which holds a string and remove the last 9 characters from it. Don't need to know what the last 9 characters are, all I care about is knowing what the other characters are in the string. I know this can be done through thingslike susbstrings, but I don't think VBA has a substring function.
View 3 Replies
View Related
Jun 17, 2008
i deal with column that has client initials, date of birth and gender, in this format t-b-23/05/72-f however i want to remove the initials and gender(i.e. f or m on the left) and - so that only date of birth remains in same column.
View 3 Replies
View Related
Aug 2, 2006
I am trying to remove all characters that aren't letters or numbers from a string. Is there any way to differentiate between a non-alphanumeric characters and alphanumeric characters? I'm thinking of something like "ISTEXT()" that I could use on one character at a time. Or are there any wildcards I could use in the Replace function?
View 9 Replies
View Related
Mar 4, 2009
I have a column of data, (10,000 entries), a list of file names basically, e.g:
Mortality Project Executive Summary.pdf
RPP - AA rate and swaps.xls
Commodities.PPT presentation.ppt
Meeting Preparation 20090302.docx
Anywho the point is I want to remove the file extensions (and of course the "."s just before), but some obviously have 4 character extensions, some 3, some 2 etc... Some documents also have "."s in the file name that I do not want to remove, basically just working from the right keep removing until the first "." is removed.
So the final list wants to be:
Mortality Project Executive Summary
RPP - AA rate and swaps
Commodities.PPT presentation
Meeting Preparation 20090302
I know I should VBA it, but I want it all in the one spreadsheet and that's a bit above me. The document has about 30 other columns.
View 3 Replies
View Related
Jun 11, 2009
my values within column A are separated by a dash. I'd like column B to continuously copy column A with the exception of the characters after the dash. example:
____A_____________B
12345-456_______12345
22456-333_______22456
1553665-45______15553665
How can I format cell B to constantly reproduce this result?
View 4 Replies
View Related
Oct 13, 2009
I have several hundred columns of data in this format: |#########|. I need to remove the non-numeric characters on the edges of the numbers so I can manipulate them. Is there an easy way to do this? I do not want to manually remove all of the characters.
View 4 Replies
View Related
Aug 15, 2013
I have very large text data which contains accented characters (E.g., "ÑÒÓÔÕÖÙÚÛÜÝàáâãäåçèéêëìíîïðñòóôõöùúûüýÿˆµ" etc.) within words.
Since I have several data sheets, some of which having 500000+ rows, Find and Replace and similar options are not viable.
I wish to replace each of these characters with regular English characters in all sheets. If that is difficult, these must at least be removed from the whole text. note that I need to preserve regular characters that are commonly used, particularly the hyphen (-) and underscore (_).
View 3 Replies
View Related
Jan 10, 2014
I want to remove all the special characters i need only texts and numbers.
View 6 Replies
View Related
Jun 9, 2014
I am currently using the following formula to remove the letter "R" from the end of cells
[=IF(ISNUMBER(--RIGHT(A3)),A3,LEFT(A3,LEN(A3)-1))].
However, I would like a macro to accomplish this goal, along with something else. I have a list of values as follows:
CHD152-2
CHD115-1
CHD40-3
RE224
HPC644R
DOC020R
HPC594R
What I need is a macro that will remove any instance of "R", "-1", "-2", "-3", "-4" from the end of a cell. neither of the 5 values listed in the last sentence are present, the the cell will be unchange. So, after running, the above values would look like this:
CHD152
CHD115
CHD40
RE224
HPC644
DOC020
HPC594
View 8 Replies
View Related