Extracting Part Of Value From A Cell
May 10, 2006
I have written a code using VB for extracting data from notepad to excel and copying the certain data like date in other cell. I need to extract a particular value from the cell where data is copied to another using mid or any other function in VB.The code is as follows:
Private Sub CommandButton1_Click()
Call data
Call compare
End Sub
Sub data()
Dim fs, f, ts, s
Dim r As Long
Dim r2 As Long
Dim e1, e2 As Variant
Dim i As Integer
Const ForReading = 1
Set fs = CreateObject("Scripting.FileSystemObject")
Set f = fs.getfile("C:Documents and SettingsAdministratorMy DocumentssheetalCingularStatus .txt").....................
View 4 Replies
ADVERTISEMENT
Oct 13, 2008
If I have some data in a cell (let's say D1) such as "m-3,s-2,xl-4", what formula can I use in say cell D2 so that if I find the characters "s-" in Cell D1, then it will return the value "2".
Similarly, in say in Cell D3, I would then want to use the same formula but modify it so that if the characters "xl-" are contained within Cell D1, the formula will return "4"
View 5 Replies
View Related
Aug 20, 2006
I have a column of cells with similar to the following text.
First Marine Avenue 18 1303 11 1
There will always be a final 4 groups of text numbers, each with a space
between, but each having different number of numbers (this particular
sequence has 2,4,2,1 - but others may be different, but always 4 groups)
The true text ( a series of Road names are potentiaaly all different, having
a sequence of words that may be up to 5 words long before the numbers start)
I need to extract the 4 groups of numbers into seperate cells, leaving the
Road name text in a singe cell. I would then have a table of 5 columns, the
first the Road text, and the next 4 columns being the group of numbers, which
I would then format as numbers.
View 12 Replies
View Related
Sep 8, 2008
I need to extract part of the data from a number of cells. I was thinking a vlookup would be the right way to go about this but i don't know how i can make it look for only part of the data in a cell.
example data Required Extraction Data
PXC-WIS-HAR075/001 = I need the data HAR075/001
GXR-Cru-WOO046/001 = I need the data WOO046/001
LST-Wis-KAV001/001 = I need the data KAV001/001
GXR-CAP-EDL001/001 = I need the data EDL001/001
RXW-ACT-WAL081/001 = I need the data WAL081/001
SXS/mf/SMI085/001 = I need the data SMI085/001
SYM-CEN-HAP001/001 = I need the data HAP001/001
SYM-Act-MAY025/001 = I need the data MAY025/001
I should have also wrote that I do have a list of the file numbers for the vlookup to.
View 9 Replies
View Related
Apr 24, 2009
Extracting part of data from cell .....
View 9 Replies
View Related
Mar 28, 2007
to extract a number from an imported cell containing text, a number and date. i need to use this number as part of a formula in another cell and the data needs to be refreshed every hour.
eg. the cell imported is "USD 30.97 (March 27, 2007)" and i need to use 30.97 in another cell.
i've tried using data - text to columns, but i realised that after splitting the cells, the 2nd and 3rd columns can't be refreshed.
View 14 Replies
View Related
Feb 12, 2009
I'm creating a worksheet that gives a list of part numbers based on the product part code. In most cases I can use the following.
=LOOKUP(O6,{0,1,2,3,4},{"NONE (M25)","SMP-55-001","SMP-55-004","SMP-55-008","SMP-55-014"})
so this gives a part number depending on what number is placed in O6. What I need to do know is look at 2 different cells and for each combination of numbers give a different part number. so if A1 is 2 and B1 is 3 give a certain result.
View 3 Replies
View Related
Mar 20, 2014
I have a directory folder with an active workbook and another workbook id like to copy data from. The Following macro opens up a file in the same directory, copies some data and pastes it in the active workbook. However with this code I have to specify the filename, 'Data.xlsm' in the example code. I would like it to copy data from the only other workbook in the current directory WITHOUT having to specify the name in the code, so just opening it up no matter what filename it has.
In addition I would like to extract the filename from the workbook im copying data from and paste it into the activewoorkbook in sheet 1 Cell A1. I had a look at getopenfilename function but cant seem to make it work for my purpose.
View 4 Replies
View Related
Nov 18, 2008
Using the below formula. I know that I should get the result of 32 if I am dong this correctly (182 matches part 1 of which 32 match in part 2).
=SUMPRODUCT(--($A$1='7. PM BDE'! $J$3:$J$366))*(--('7. PM BDE'!$L$3:$L$366=1))
View 3 Replies
View Related
Feb 12, 2014
Is there any way to remove the first part of a string of text in a cell and save the second part?
The first part of the text string is a team code that has a variable number of numbers, capital letters and sometimes spaces. The second part of the text string is a variable number of words in a team name that all start with a capital letter and have lower case letters. Every line has a different team code and team name.
The original spreadsheet also has a column with just team code. Is there a way of using this column to "subtract" the team code from the text string to just leave the team name?
View 5 Replies
View Related
Feb 6, 2008
I have a sheet where i have many differently named areas (like state1_1 and state1_2) When I doubleclick on a cell then a macro should run with following criteria: 1) Macro will run if the doubleclicked cell is part of any range in the list. Here I mean that names of ranges which belong to that list start with word state (like state1_1 and state1_2). No other ranges should not be in that list. If the cell is not in the range that is part of the list, then nothing should happen.
View 2 Replies
View Related
May 29, 2009
In one column (Column A) I have a column of data which contains long descriptive text - i want to extract a specific piece of text from this descriptive text and enter it into the next Column (Column B).
E.g. Cell A1 = "Hello Buddy, how are you?" - i want to extract the word Buddy and enter it into cell B1
then A2 into B2, A3 into B3, etc, etc,...
Is there a simple macro out there that can do this?
View 7 Replies
View Related
Dec 10, 2008
I have a spreadsheet with 2 worksheets. On the first "active parts" I have a list of active part numbers and on the second "All Parts" I have all of the parts available.
I want to compare every part in the All Parts worksheet to see if the part number exists on the Active Parts sheet - if it's there, I would like it to return the value "Active" in column B in All Parts. I have a formula in column B in All Parts that seems to work for the first few, but as soon as it finds one that is active, the rest of the cells below all return "Active".
View 3 Replies
View Related
Aug 4, 2007
I have 2 basic parts to a Macro which need to be separated by a pause of 1 second, before proceeding to the next part of the macro. Then pause for 1 second, and loop.
Application.Wait is no good to me as the spreadsheet must remain live, editable, and receiving updates from an external program linked via DDE. Below is the ...
View 6 Replies
View Related
Jan 22, 2014
i have a column of data part number part text e.g 7w1,8b1 in the next column i want to write a function that will look at the other and dependant on whats in it place a word e.g. for 8b1 i need it to look at the "b" and enter beauvale if theres no "b" but a "w" enter wollaton, i have tried an if function and used "*b*" but it doesnt seem to like wildcards ....
View 9 Replies
View Related
Apr 18, 2013
I have some cells with text entered in column A.
These cells contain a time reference either in '09:30 - 16:30' format or just an 'AM/PM' format.
What I need to do is to populate column B with the part of the string that comes AFTER the times in the text (either in hh:mm format or AM/PM format)
Example
336 Data 2012 Classroom Induction 2012/08/28 09:30 - 16:30 data about this ------> data about this
336 Information about this 2013/04/04 09:00 - 13:00 Information 2 ------> Information 2
336 info CHS Suffolk 2013/05/07 PM DRC, BSE ------> DRC, BSE
364 information 2013/02/12 AM DRC, BSE ------> DRC, BSE
I cannot get this to work and cannot use Text To column as there is no character I can use to split it.
View 4 Replies
View Related
Nov 24, 2008
I need to find the "x" in range C2:C44 and replace it with a value (variable) specified in cell I2
The catch is that I then need to be ablt to change that character when I2 changes.
Coloum C
*VER
*T’x’STATUS
*ON
*OFF
*T’x’BANDS
EG
I2 - Variable = B
*T’x’STATUS will become *T’B’STATUS
I2 - Variable = A
*T’x’STATUS will become *T’A’STATUS
But " *OFF " should not change.
I can change *T’x’STATUS to *T’B’STATUS but then I can change *T’B’STATUS to *T’A’STATUS
Please see attached example file as it shows it better than I can explain it.
View 11 Replies
View Related
Aug 14, 2014
In one cell I have multiple value:09/16/2013, 09/16/2013, 09/16/2013, 10/15/2013
I want to use the first read which is 08/22/2013. Not always i have multiple dates in my table.This is part of code that I am working on.What I usually do, to get the last value when I have multiple reads is:
I have select the cell C1, the multiple reads(dates) are in the cell B1, so i need the last read(10/15/2013) ;i use this code:
ActiveCell.FormulaR1C1 = "=RIGHT(RC[-1],10)+1"
SO now I want use the same logic but i want to take the first read/date. Also here the cell from where I want to get the value is selected.
Above the multiple reads were in the cell B1 and cell C1 was selected before performing the code, now the code is in the cell B1 and B1 is also selected.
I tried to do ActiveCell.FormulaR1C1 = "=Left(RC[-1],10)" but I rich the value in the cell on left which is A1. I want this for tomorrow since I have something to present.
View 1 Replies
View Related
Dec 26, 2013
I have a cell that contains values such as "AAPL" or "0001.HK" (without the quotes). I would like to extract the content to the left of "." (if any). i.e. I want the cell to return "aapl" or "0001". What formula should I use?
View 9 Replies
View Related
Jan 1, 2014
I'm trying to extract the first name from each row in column a using:
Formula:
A B
Joe Smith Joe
Julie Smith Julie
Julie #VALUE!
If the cell does not have 2 names it's giving me an error.
View 10 Replies
View Related
Jan 30, 2009
I'm trying to extract pieces of a part number and place each section in another cell. It's kind of like a text to columns, but in a formula and removing part of the data. This is what I'm starting with: Cell 3A: HB149E.505
I'm trying to figure out a formula that will fill the following which are currently blank:
Cell 3A: HB149
Cell 3B: .505
Cell 3A will always have 5 digits prior to the decimal and 3 digits afterward so that is not a problem.
View 2 Replies
View Related
Jun 25, 2009
Need formula to extract the text from a cell, with which a vlookup will be preformed on? For example if a cell contains: 116PH(604052) I would need to perform a vlookup on the PH.
The problem is that the "PH" in this case can vary where it's at in the string of numbers. Also, some cells may only have a three digit number with the two letters following. See my attached spreadsheet as an example. The current formula I have in column A on the attached spreadsheet performs the vlookup fine if there is only the three digit number followed by the two letters, but as I've outlined above, this isn't sufficient.
View 4 Replies
View Related
Jun 17, 2008
I receive a workbook on a monthly basis and it arrives in csv format. I need to format it and split it into several pages prior to sending to managers. I'm comfortable with the vba for formatting and splitting it into several pages but I have a problem with some cells that always have data in them in the same (incorrect) fashion.
how to go about fixing these cells and then I can get on with writing that into the macro.
Currently looks like:
A || B || C
No requested || No Supplied || Percentage
4 || 4100%
12 || 875%
6 || 350%
Should look like:
A || B || C
No requested || No Supplied || Percentage
4 || 4 || 100%
12 || 8 || 75%
6 || 3 || 50%
I was thinking of some kind of Left() formula to extract the leftmost character and place it into it's new cell BUT realise that sometimes I might need to extract 2 (or perhaps even more) characters.
View 14 Replies
View Related
May 7, 2009
I'm trying to extract information from one specific cell, and place it into another. This other thread kind of does what I'm looking for. I wish to extract from the following; "20/04/2009 5:42:51 AM". Placing the date in one cell, and the time in another. All spacing within the quotation marks is respective of the cell. Obviously dates and times would vary.
View 4 Replies
View Related
Feb 24, 2009
I have a cell containing text and numbers not in same order.. how do I extract only the number out into a cell.
View 14 Replies
View Related
Jul 4, 2009
i have in a cell a Text like this..
Chicago (TZGUG)
i tried a formula.. like this..
=LEFT(F3;LEN(F3)-1
to remove only ) ..
but how can i remove the ( too ..
and also Chicago
so the result in a cell would be TZGUG
View 11 Replies
View Related
Dec 21, 2011
I currently have an issue with sorting data that i download into excel.
I have a list of rows that have text that look something like the below:
redeem: 141BA9835E Colour: Silver
I want to copy only the colour at the end of each of the colours into a new cell. So in theory the formula will pick only the colour out. Below is a list of more rows as an example where it changes slightly:
redeem: C3CC237E3C Colour: Silver
redeem: db56b2177c Colour: Pink
redeem: 7d3fe7eba2 Colour: Black
redeem: EBE56BDA7A Colour: Silver
To summarise have can i extract into the cell next door, only the colours from text
Currently i am having to manually type only the colour into a cell, and it is taking forever when you have 1000's or rows
View 9 Replies
View Related
Oct 5, 2012
I have a column with numbers in. The column has been formatted to include a currency code but this can change on each row, e.g. M1 may be £20,000,000, M2 may be $40,000,000.
I want to insert a column prior to this column and extract the currency so that in L1 I would have £ and in L2 I would have $.
View 2 Replies
View Related
Jul 24, 2013
I have a bunch of contributions events and I am trying to extract the date ... for example. each line has "contribution 11/02/2011" or "contribution 12/17/2010" is there a formula that will pull out the date. this way I don't have to do it manually.
View 1 Replies
View Related
Mar 4, 2014
Cell A3 has the formula: "=MOD(H16-H15,1)"
Cells H16 and H15 are time entries
If H15 = 12:00pm and H16 = 2:00pm, the result in A3 = 2:00
Cell A5 has the formula: "=A4*A3"
In cell A4, I enter a number, say "4", which produces the result "8" in cell A5
Now...I want to add to the formula in cell A5 to make it "=(A4*A3)+A4". The result I WANT in this example should be 12 but no matter what, the answer always ignores the "+A4" part and always just gives me A4*A3.
So the question is, how do I extract the result "8" from cell A5 as a number to which I can add (or subtract...or ANYTHING) other numbers accurately?
View 3 Replies
View Related