Extract Last Part Of Workbook Name

Jun 10, 2008

Is there a way to extract a specific part of the workbook and save it as a value in VBA:

For example:

Workbook title is "Data Set 2007" How would you extract 2007?

View 5 Replies


ADVERTISEMENT

Extract Part Of Any Workbook Into Another

Apr 10, 2007

I need to have a macro written which will allow me to extract information from any given workbook and copy them to my workbook. I'm thinking along the line of creating an input box upon opening the workbook, asking for the name of the workbook which contains the data. I would then use the data from the workbook and extract bits of information which I would copy to my current workbook.

However, I can't seem to figure out how to direct the answer of the input box to extract the information out of the target. And how would I refer to the workbook with the data in my code? I would need to refer to the data workbook as I need to extract information from it.

View 5 Replies View Related

How To Extract Part Of Formula

Feb 2, 2010

I need to extract the part of formula in a cell. How can I do that?

For instance; I have formula: =C2/3579 in cell E2

I want to copy the last part in that formula i.e. 3579 to some other cell.

The last part (3579) is not constant in every report. It may vary in each report thus the length may vary from 4 digits to 5 digits also.

View 9 Replies View Related

Extract Web Data From Part Of Page

Dec 31, 2008

I would like to extract some data from a web page, but only part of it. The website is:

[url]

and I have a spreadsheet with many different ProjectId hyperlinks in a column (the final six-digit number). All I want is the large block of text that is in the middle of the page. Sometimes there is no text, as in:

[url]

So I don't know how to deal with that either...

I would just like to paste the text into a cell adjacent to the hyperlink. I know that there is a visibility issue with 1024 characters, but can cope with that (no text will be longer than the 32k+ chars).

Any help would be appreciated - it's for my wife's PhD, and I just want to make it easier on her. I am reasonably ok with macros, but am by no means expert! If you need clarification,

View 9 Replies View Related

Extract Numeric Part From The String End

Sep 27, 2006

Extract Numeric Part From The String End with a macro, that J8 will turn 8, and R4 will turn 4.

View 9 Replies View Related

Extract Part Of Text String

Aug 10, 2007

CREATE TABLES LIKE BELOW?Column 1 Column 2
8 6CSS130 + 2CSS200g x10hanger 200 GM
250ml B2G1 Towel in bagx24 0607 250 ML
18 g-Mint 18 GM
100g 100 GM
150GM 150 GM

i have a data as above, i wanna to extract the 250ml from the column 1, only 250ml (basically i want to extract the size code like 150g, 100gm from the data above).

View 9 Replies View Related

VBA - Extract Part Of A String According To Position / Markers

Sep 11, 2012

I have been confronted with an issue that has bugged me: Now do I extract a part of the string according to lets say "markers"?

Here is what I mean:

I use the code below to get the bottom range of my tables:

Code:

blimit = Activecell.Address

I haven't had problems because my tables were small, then I would:

Code:

blimit = Right(blimit, 3)

If the table was small there was no problem, since lets say the Activecell.Address = "$C$123", resulting in blimit = 123.

My how do I extract a part of the string, knowing I have 2 "$" ? That way I would make a version of this that always works.

I cannot use FIND or any formulas I am aware of since they all start counting from Right to Left... I thought of using Replace() to get the first "$" and change it for something else like "-" then looking for the second "$". But Replace() basically changes both signs... making my idea... well obsolete...

View 2 Replies View Related

VBA - Extract Part Of String According To Certain Position / Markers?

Apr 10, 2014

Now do I extract a part of the string according to lets say "markers"?

Here is what I mean:

I use the code below to get the bottom range of my tables:

Code:
blimit = Activecell.Address
I haven't had problems because my tables were small, then I would:

Code:
blimit = Right(blimit, 3)
If the table was small there was no problem, since lets say the Activecell.Address = "$C$123", resulting in blimit = 123.

My how do I extract a part of the string, knowing I have 2 "$" ? That way I would make a version of this that always works.

I cannot use FIND or any formulas I am aware of since they all start counting from Right to Left... I thought of using Replace() to get the first "$" and change it for something else like "-" then looking for the second "$". But Replace() basically changes both signs... making my idea... well obsolete..

View 2 Replies View Related

Match Part Number Then Extract Quantity Onto A Different Sheet

Apr 3, 2014

I have 2 sheets in a file. One is given to me from our parts department containing all parts on a given truck model. The 2nd sheet is exported as a database file from inventor and imported as an update able sheet in excel.

I am needed to compare part numbers between the 2 sheets and the qty of each. So far I have it where it matches the part numbers and turns the ones I don't have in the model red. Now I'm trying to match the part numbers and pull the qty of said part from sheet 2, the imported one, and compare it to the to the qty in the 1st. All I really need to accomplish is matching the part numbers then copying the qty from sheet 2 to sheet 1 onto a new cell of the matched part number.

View 3 Replies View Related

Extract And Copy Part Of Text String From One Cell To Another?

Aug 22, 2014

I have to sort list of thousands name (3000 names) and remove duplicates. My problem is majority of the names have their title (i.e) Prof. Dr. Ir. Sir. etc typed in, so I need to copy the title in different cell and have their name only. Here's what I expect:

Current List ----> Column A -->Column B
Drs. H. A. Andrew Boston, MRE. ----> Drs. H. --> Andrew Boston, MRE
Drs. H. Andrew Smith ----> Drs. H. --> Andrew Smith
H. Abd. Mohammed Junus ----> H. --> Abd. Mohammed Junus
Prof. DR. Jane Doe, MD ----> Prof. D --> Jane Doe, MD
Prof. DR. Ir. H. Randy Wong, MBA --->Prof. DR. Ir. H. -> Randy Wong, MBA
Dra. H. A. Karen Patel ----> Dra. H. --> Karen Patel
Drs. H. A. M. Kangkong ----> Drs. H. A. --> M. Kangkong
Prof. Drs. H. A. Kareem Saleh, Ph.D -> Prof. Drs. H. A. ->Kareem Saleh, Ph.D
Dra. Hj. Nina Schorder ----> Dra. Hj. --> Nina Schorder
Ir. Abdul Jabbar ----> Ir. --> Abdul Jabbar

View 1 Replies View Related

Extract Part Of Cell By Searching For Data Within Cell

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

Assigning Variable To Part Of Workbook Name?

Dec 22, 2011

Ive wrote some code that goes into a workbook. This code then opens up a "master" workbook which has 18 blank tabs in it and then proceeds to open up 18 other named workbooks one at a time and copy some date from these workbooks to the master (i.e workbook 1's data goes to the master workbook on tab "1".)

I have this working no problem but here is my snag.

The workbook name changes every week to correspond with the date (i.e 1_14DEC2011.xls then 1_21DEC2011.xls).

Ideally id like to be able to create a variable for the latter half of the filename so that i can apply this variable to each filepath but i cant quite get it to work.

A small sample of my code is below (and yes i know it is very blunt but so is my knowledge at this stage!)

Code:
Sub collate()
Application.ScreenUpdating = False
Application.Calculation = xlCalculationManual

[Code]....

View 2 Replies View Related

Reference Cell From Another Workbook With Part Of Location?

Feb 20, 2014

I have the following formula/array:

='fake folder location[2013-004.xlsx]MgmtRpt'!$A$4

Now this works perfectly fine, but I am wondering if it is possible to replace 2013-004 so that it reads the text from a cell on that sheet to complete the file name.

Example:

A
B

1
2013-004
='fake folder location[2013-004.xlsx]MgmtRpt'!$A$4

I want to replace the 2013-004 in B1 with text from A1. I have tried multiple methods but it just always assumes it is part of the file name or breaks the formula.

View 2 Replies View Related

How Do I Subsitute Part Of A Formula Linked To Another Workbook

Jul 26, 2007

I've run into a roadblock in excel 2003 in trying to create an accounting spreadsheet that will pull in information from several separate workbooks (invoice files) using formulas which substitute invoice Nos. (which coincide with the tab/worksheet names).

My obstacle has something to do with order of operation/calculation I presume... I've successfully used labels to bring in information from separate tabs on the same file by using the substitute function with generic formulas.... in this case exel processes the formula, likely because it calculates the linked information first in its order of calculation; then trys to substitute information into the result of a calculation already made....

I'm trying to find a way to tell excel to look at respective cells in the same file but on a different tabs/sheets...

For example; I've been trying to pull in the date an invoice was issued for client "X".

I plug in a formula in a remote cell of my accounting spreadsheet "Y" which basically says to bring in the value on file ["X"]; worksheet "tab"; cell $J$11 - where "tab is just a filler that I would like to use the substitute function to exchange with respective invoice Nos. (i.e. 049; 050; 051; etc.) My hope is that by adding these 3-digit sheet identifiers; all other information from respective cells (in file "X") will be pulled into my accounting sheet - file "Y" (i.e. invoice total; applicable pst; gst; expenses; etc.) I have written as many formulas as required for the different types of info sought after, the only variable being the 3-digit worksheet identifier. The problem has been that excel first processes the formula in the remote formula cell(in file "Y"); then applies the substitute function to info already brought in from File "X"; whether it is a date value; or a currency value. I can't figure how to have the substitute function change the formula... not the result of the original function...!

I've tried to format the source formula cell as text (therefore not calculating a result at that instant) however the substitute function inherits the format of the source formula cell.

View 11 Replies View Related

Open/close Workbook Depending On A Part Of String

Jul 26, 2007

I have create a menu with buttons that are attached to the different projects of vba. This menu will be put in the server of my department so all my colleagues can take profit of the macros. Is a menu in an excel file that only contains the vba projects, not the sheets where the macros are supposed to run. My problem start when you want to open the file. It will always be in the same disk "P:COAP", and then there are more subdirectories (year, month)... so the total path, for example, this month is:"P:COAP2007200706". But every month, it changes, logically.

The problem is that i need to open a file with the name "COAP-200706 Concentració Empresa Emissora" in this case... the only thing that changes is month, and year...
I want to close the booke i choose, to avoid errors, if the name of the workbook chosen is different to a part of this string. In this case, i'm trying to close the book if the name of the file or the book don't contains the string "Concentració Empresa Emissora", without saving changes, of course... because sometimes people have chosen badly the files and they've made a disaster. If the file chosen contains this string in the name i want to continue with all the code that is written after.

ChDrive "P:"
ChDir "P:COAP2007"
NouFitxer = Application. GetOpenFilename
If NouFitxer = "" Then Exit Sub
Workbooks.Open Filename:=NouFitxer
If ActiveWorkbook.Name <> "*" & "Concentració Empresa Emissora" & ".xls" Then
Msg = MsgBox("Error in the file opened. Look at the name of the file next time." _
& vbCrLf & "The program will close without finishing the process. Start again. Thanks", _
vbOKOnly + vbCritical, ("END OF PROCESS"))
ActiveWorkbook.Close Savechanges:=False
Exit Sub
End If

View 2 Replies View Related

Reference Part Workbook Name In Formula From Date In Cell

Feb 20, 2008

i want to return a value from a cell in another workbook where part of the the workbook name is determined by a date set on the current open sheet.

so on my open sheet i have a cell where the user can change the date and i want the below formula to then use the date to look at the relevant file.

any ideas would be appreciated. know how to do this in VBA but no clue with formulas.

what i am trying to do is concatenate part of a file name and a cell value which contans a date

=VLOOKUP(A4,[accountsummary17022008.xls]Sheet1!$A:$B,2,FALSE)

View 3 Replies View Related

Multiple Lookup: List Of Part Numbers Based On The Product Part Code

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

Extract Two Coulms From A Workbook With 31 Tabs

Dec 31, 2008

I need to extract two coulms (AQ,AR) from a workbook with 31 tabs, I want colated the same colums from each one and copy into a new workbook. I have been searching for hours but have failed.

View 4 Replies View Related

Extract Data In Three Different Columns To New Workbook

Jan 18, 2009

An excel file with over 400 worksheets in it. I need to copy the data, a bunch of numbers, from column C, column F and column I, and paste them in a new file or worksheet all in column A of the new sheet.

All of the 400+ worksheets have these numbers I need to grab in the same columns- C, F and I.

I spent most of the day Friday cutting and pasting. I am experimenting with macros, but I am just not that good.

View 9 Replies View Related

Using VLOOKUP With LEFT To Extract Data To Another Workbook

Aug 20, 2014

I have a workbook which has data from 2 different time points (6 and 12 months) and this is signified by a prefix to an ID number which is a letter (A or B) and a number:

I need to analyse data separately so I'd like to create 2 separate workbooks, once which imports all of the 6 month data (1 row per case) and one for the 12 month data.

I thought that this would be based around a VLOOKUP of the first 1 or 2 characters but I can't work out how to integrate this with an 'IF' and link it to another workbook.

View 4 Replies View Related

Extract Data From Sheet1 To Sheet2 On Same Workbook

Jan 10, 2014

Basically I have two sheets. Sheet1 and sheet2 on the same workbook. The sheet1 is where all data I want to extra to the sheet2.

Here is the sheet1 looks like:

1
B
C
D
E
F

2

Tester :
Mr.ABC
3
State :
CA
4
Phone :
123456
5
6
Header1
Header2
Header3
Header4
Header5

7
Value1
Value2
Value3
Value4
Value5
8

From B2 to D2 the cells are merged as well as the B3 to D3 and B4 to D4. Note: No Column A.

Here is the sheet2 looks like:

1
Tester
State
Phone
Header1
Header2
Header3
Header4
Header5
2
3
4

So, sheet2 has the header and what I need is to fill the information based on the sheet1.

I am thinking using the Vlookup but maybe VBA is better off to handle this situation?

View 7 Replies View Related

Macro: Extract Data From Closed Workbook

Nov 17, 2006

I'm trying to create a macro that will allow me to extract data from another workbook (whose name and location is listed in a defined cell) and populate a range in my new sheet with this data.

Ideally, I want to be able to do this without actualy opening the source file, but any means to this end would be great!

I know this was possible in Lotus 123, but have not yet found a way to do it in Excel.

View 3 Replies View Related

Extract Dynamic Data From Closed Workbook

May 11, 2007

i have this code that could extract out Data from many closed workbook. I am extracting data from 2-3 thousand files and the Data in those files are rather dynamically positioned.

For e.g. My vba codings will extract data from cell B256 of the closed workbook.

Sometimes, the data might not start from that cell which my vba would still extract that non-relevant data.

Is there anyway i can modify the codings to search for the required data and extract instead of extracting it dumbly?

Sub getINFO()
Dim lCount As Long
Dim wbResults As Workbook
Dim wbCodeBook As Workbook
Dim rCell As Range

View 9 Replies View Related

Excel 2007 :: Extract File Contents To Workbook

Mar 17, 2014

I have large number of sql files in various folders in my windows7 laptop.

I have extracted the file names with full path in column A in an excel work book.

For each row, I now need to parse the file and extract the file contents and put it in column B, for the respective row.

I want the entire query content to be populated in the row without parts of query to spillover to other column (based on comma etc in the query)

I am using excel 2007.

View 3 Replies View Related

Extract Data From Files Within The Same Directory Or Below And Place In New Workbook

May 3, 2006

Firstly, I have attached a file called test2 which has two sheets within it, one called list and one called 12345. This is for demonstration purposes only as in real life these are both separate files.

What I am trying to do is create a history in the file called list that extracts certain data from the file called 12345 and places it in a more user friendly format. No problems with the formulas etc, just a case of a few ifs and buts.

My real problem lies in the fact that file 12345 is only one of hundreds of files and in order to create the history, I have to repeat the process on all the other files, so that the list grows as I copy the data.
Again for demo purposes, the file "list" sits in the C root ie C:list and the job files sit in C:files*.*.

Is there a way to automate the process so that formulas or VBA residing in the file "list" searches through the C:files*.* and populates the list as it runs through them.

View 9 Replies View Related

Open A File, Extract & Paste The Filename Into Another Workbook

Aug 1, 2006

Am working on a procedure to open all files in a folder and copy some data from the files into another workbook (master). I have this piece of the code. However, I also need to get the filename (from which data was copied) and paste this into an adjacent cell in the master (so I know which file each data point came from).

View 8 Replies View Related

SUMProduct (182 Matches Part 1 Of Which 32 Match In Part 2)

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

Remove First Part Of String Of Text And Keep The Second Part?

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

Extract Information From Closed Workbook Representing Data From A Country

May 22, 2013

I'm having a problem with getting a result from another workbook. The purpose is to extract information from a closed workbook representing data from a country (ie US.xlsm, UK.xlsm) into the open one (summary). I want to count the number of results in a column which are above a certain amount (in this case 100).

So this is my coding for getting this result

=SUMPRODUCT(--(('C:address[US.xlsm]Worksheet name'!$E$2:$E$30000)>100))

Which works no problem for getting the number of results in the E column above 100. my issue is that I want to be able to change the name of the country in a cell, and then get the results automatically from the relevant workbook. I've been using CONCATENATE for these purposes and EVAL (from MOREFUNC)... and I get #REF!

So if I split up the above coding into two cells "=" and "SUMPRODUCT(--(('C:address[US.xlsm]Worksheet name'!$E$2:$E$30000)>100))" (just to keep it simple) and then use CONCATENATE to combine them in a cell. Using EVAL on that cell gives me #REF!

I've tested SUMPRODUCT with EVAL and CONCATENATE on formulae like the one above which do not link to other workbooks, and they seem fine. and SUMPRODUCT and linking to a workbook also works fine in the first example.

So the problem is somehow coming from the combination of SUMPRODUCT, EVAL and accessing an external sheet.

View 4 Replies View Related

VBA Code To Get Formula Into Each Worksheet Then Loop To Extract All Worksheets Into Master Workbook

Aug 26, 2012

I wanted to know if there is any way possible to get vba to insert a formula in a cell to each worksheet in each workbook in a folder and then using loop to extract all the info from each worksheet of each workbook in same folder into a master workbook?

View 1 Replies View Related







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