VBA - File Prefix Only?

Jan 3, 2009

Say I have a workbook called test1.xls, where the number 1 at the end of the file name is variable. Tomorrow that character could be 2 so the file would become test2.xls etc (or could even be a letter for what it matters).

Is there a way in Visual Basic to recognize that the final character is not fixed but can get different values each time? Or in other words to recognize that the file starts with "test", and that whatever follows that prefix is not relevant?

For example....

If ActiveWorkbook.name = "'test*.xls" Then...

where * (star) could be any character.

As a Windows analogy, I am thinking of the * (star) character when one searches a certain directory for, say, Excel files (*.xls etc). Obviously, in VBE that doesn't work, and the star is just a character like any other.

View 3 Replies


ADVERTISEMENT

Replace One Prefix With Another Prefix

Jan 23, 2010

UDC 01_001 template black.jpgBatch 01_385 template white.jpg
UDC 01_001 template blue.jpgBatch 01_385 template blue.jpg
UDC 01_001 template grey.jpgBatch 01_385 template grey.jpg
UDC 01_001 template pink.jpgBatch 01_385 template pink.jpg
UDC 01_001 template white.jpgBatch 01_385 template black.jpg

I have 100s of urls with prefix as the left column. I need to rename them to the right column format. UDC 01_001 will take number Batch 01_385, UDC 01_002 will use Batch 01_386 and so on.

I cant figure out how to do this in one quick macro instead of replace function.

View 7 Replies View Related

How To VLOOKUP With Prefix

Dec 12, 2013

G1 = will be one of these 12 choices: 01 January or 02 February or 03 March...or 12 December
K2 = Date I performed the task
D2 = Name of Inspector

I usually manually input on G2 the name of the report.

Example:
G1 = 12 December
K2 = 12/05/2013
D2 = Chris Mart

Therefore, I need to manually input on D2 = 13-12-MARTCL

Where....

MARTCL comes from a table where I have all the inspectors and their corresponding username.

That table is O2:P63. O1= Title of row (Username), P1 = Title of row (Name of inspector)

13 = year extracted from 12/05/2013
12 = Month of inspection (which can be extracted from G1 or K2)

How do I use cell reference AND VLOOKUP to create 13-12-MARTCL on G2?

View 8 Replies View Related

Add A Text Prefix

Oct 25, 2008

I have a colummn of data (text data). For my purposes I would need to add a prefix text to every single cell contained in that column; for instance, if I have a cell with a text "hellohowareyou" ,

I would need to change it by adding to it a constant prefixation text "es_ES@" so that the final result would be displayed like "es_ES@hellohowareyou" , and so on for the rest of the cells under the same column.

View 6 Replies View Related

Trying To Use IF Statement For Prefix Only

Jul 1, 2006

I’m making a database to forklifts. Most used code I have found from this forum. I haven’t found a way how to copy existing formulas on summary sheet so that sheet name is also changed in formula. I attached also my workbook, but it’s not in English language but in Estonian. I hope that isn’t problem.

If pressed button on summary sheet (“Pealeht”) then existing blank sheet are copied and renamed. On userform1 is textbox3 which value added to summary sheet, also combobox4 value added to summary sheet. Now I want that if pressed commandButton1 on userform1 then all formulas what exist on summary sheet from F6 to CW6 are also copied to next row and in formula sheet name changed. My second question is what to write that if new sheet created then it goes always to end of existing sheets. Right now I’m using code what copies new sheet after blank sheet but it’s not satisfying me.

View 5 Replies View Related

Making Sure Cell Has 'J' Prefix

Nov 23, 2008

i have a cell "h23" that must always start with a "j" or a "J"
the trouble is some of my users are only putting in the number
ie 2345 when it should be j2345 or J2345

View 3 Replies View Related

Filtering In Dropdowns With A Prefix

Feb 20, 2010

I'm not a novice but this might be something simple I didn't realize. I am creating a quoting sheet for a steel fab company. I have created dopdowns for the different materials and sizes but the dropdown is way too big. I need to have a column that helps me filter the dropdown more so I don't have to scroll through litterally hundreds of steels to find the one I need. The good news is that most steels have prefixes that make them easier to filter.

For example:

L-3x3x1/2
L-2x2-1/2x1/4

C6@8.2#
C8@11.5#

W12@16.0#
W21@44.0#

What I'm looking for is a way to have a dropdown that has all of the prefixes (L, C, MC, W, PL, etc) in it and when I select one of them the next column (the actual description of the steel as shown above) will only give me the specific steels for that steel shape (L,C,W,etc)

Currently I'm putting one row of say the MC shapes and one row of the C shapes and one row of the L shapes then copying them as needed. It's a lot of work and you can easily make a mistake.

View 12 Replies View Related

Vlookup Based On Prefix

Feb 11, 2009

I have a table like below
A B
1 x1234 value
2 y1234 value

If I want to look for all values that start with "x", is there a way to do it within a vlookup formula? Something like: vlookup("x*", A1:B2, 2, False). I know there's other ways to do this, but I want it all contained in one formula instead of splitting the A column using LEFT(A1, 1).

View 4 Replies View Related

Removing 1- Prefix In Phone #'s

Apr 9, 2009

I read the thread below on how to utilize the Subsitute function to remove periods and thought about being able to use it for this. However, I have some phone #'s in my list that contain multiple 1- scenarios in them because the area code or 3-digit prefix sometimes include a 1- also. How do I make the formula only look at the 1- for long distance and not any other 1- found in the phone #? I want to remove all of the 1- for long distance because we are trying to use a new autodialer that is pre-programmed with the 1-.

View 8 Replies View Related

Add Prefix In Specific Cell

Mar 21, 2013

VBA code to add prefix "HR" in cell H11. So no matter what I type in cell H11, for example 123456 when I hit enter I would like that in that same cell stands HR123456.

View 4 Replies View Related

Delete Worksheets With Specified Prefix

Nov 7, 2009

I have several excel workbooks with many worksheets (over 500 in some). Around a third of these worksheets are named "Exp1", "Exp2", "Exp3", etc.

I would like a macro that will delete all worksheets that do not have names starting with the letters "Exp". I do not want any confirmation dialogue, and as the workbooks vary in size, I would like it to finish when there are no sheets left (except the Exp ones of course).

View 3 Replies View Related

Prefix Text On Entry

Jan 11, 2007

I have often used Data Validation List to create selection lists for cells in a worksheet. The problem is the list has to be on the same sheet you want to use it on. Is there any other way to do this so one common list can be used for all sheets? I have a list of accounts I want to use on 12 different Monthly tabs.

View 5 Replies View Related

Add Prefix To Selected Cells

Oct 19, 2007

for a small online database I have a column that lists nationalities:

French
Spanish
American
Latin American
(etc etc)

I need to add a prefix to all nationalities, for example:

Artist Nationality///French
Artist Nationality///Spanish
Artist Nationality///American
Artist Nationality///Latin American
(etc etc)

Is there a way I can select the 700 cells and do this in one shot? I can't add formulas because I will have to paste all this in text pad and then upload it.

View 5 Replies View Related

Prefix Cells With Text

Dec 7, 2007

I want to add "CR" to the beginning of every cell that already has data. I know I could do =a1 and it would copy all the way down. However each cell has different data and I'd like to keep it that way but add 2 letters in the beginning.

View 3 Replies View Related

Insert Prefix Based On Cell Value?

Jun 3, 2014

I have lists of numbers in column A. Based on the number in the cell, I would like to insert RO_ or RP_ before the number. I currently have two buttons for this, one named RO and the other RP and have simply recorded a macro of what I wish to do. However, instead of inserting RO_ or RP_ before the number the macro replaces the hole lot with "RP_10" or "RO_10" as this was the cell i recorded the macro on. How do I make it so it just inserts the Prefix rather than replace the contents of the cell.

Currently my code for one of the buttons is as follows;

[Code] .....

View 1 Replies View Related

Extract Numbers And Prefix Letter

Aug 21, 2009

I need to extract (and then use for SumIfs) only item numbers from the long description. Please see the attached list where item number column shows existing list & next column shows what i want to extract. The exrtacted part if has any trailing or succeeding letters, characters between numbers should stay. for example from "SGA:RV-SVA:PEPPERS/PEPPERONCINI:SV9176001/232034" I need to extract " SV9176001/232034" or from " SPICES:BULK SPICES 7100:9054B" I need to extract " 7100:9054B". Can some one please urgently help me on this.

View 9 Replies View Related

VLOOKUP Ignore Prefix In Table

May 24, 2012

Is it possible to create a vlookup but when it look in the table to ignore the letter i have prefixing.

=VLOOKUP(H8,'[1-90 week summary 08-01-10.xls]Sheet1'!$E$2:$F$501,2,TRUE)

H8 contains numbers ie 237 but the Table contains S237. what can i do so the lookup ignores the "S".

View 7 Replies View Related

Adding Specific Prefix To A Column

May 25, 2012

I need to add a specific prefix (in this case DR- ) to a whole column. The problem is I have some cell that already have the prefix while others don't. I also have some cell with value N/A and I don't want them to get the prefix either

PHP Code:

___C___
DR-1220 
1222
 1233H
DR-1220 
1222
 1233H
[Code] ......

What I need them to be is :

___C___
DR-1220
DR-1222
DR-1233H
DR-1220 
DR-1222
DR-1233H

[Code] ....

The text need to be search able (no formula ).

View 6 Replies View Related

Adding Zeros To The Prefix Or Certain Numbers

Mar 2, 2009

Im basicaly pulling a report wherein the details will have a column as number.

It basicaly should be a three digit number. The tool will have the information as below.

VNO005016017008019020021

But when im pulling out the report into excel, the zeros in the prefix goes away and the report looks like the below

VNO516178192021

I just checked the tools previllages and it seems that we cannot do anyting in pulling the data as it is in the tool.

So wht im trying to do is to save the report in a folder where i have placed a validation sheet which will have references of the parent report.

So when i open the report the reference will pull up the data and in here i would like to add a validation which will add "0" in the prefix if VNO is a 2 digit number or "00" if the VNO is a one digit number.

View 9 Replies View Related

Removing Prefix From Part Numbers

Sep 21, 2009

I have a huge column of data. This data has few prefixes that I need to remove. I have a list of possible prefixes. Some prefixes are 1,2,3 or 4 characters long. Could you please suggest best way of removing these prefixes (VBA if possible)?

Following are some of the examples of prefixes:
AB
GD
KR
BCD
FP-
TJ-
W

View 9 Replies View Related

Sum Values With Names Based On A Number Prefix

Feb 4, 2010

How can I sum values with names based on a number prefix? For example, in the attached sheet, how can i sum all values that have the prefix 4.10.02.xxxx?

View 2 Replies View Related

Adding Prefix To Each Unique Entries In Cell

Jun 12, 2013

prefix.xlsx

I'm finding difficult to find add prefix to unique entries in the column.

For example:
82328331 is appearing 5 times in the column.
so i need to add
82328331A
82328331B
82328331C
82328331D
82328331E.

Likewise i need to add alphabetic series to all the values in the account number column. so i can create unique account number.

Find the attachment : Attachment 242493

View 5 Replies View Related

Naming Sheets With Time-dependent Prefix

Apr 21, 2009

I have got this macro working OK but now I need to add a 2 letter prefix/suffix depending on what time it was created (am or pm). Detail: If the sheet is created between 0600hrs and 1800hrs then "DS" and likewise between 1800hrs and 0600hrs then "NS". Outcome: The sheet will then have a name like - "22 Mar DS"...code included below

View 4 Replies View Related

Random 3 Letter Prefix Form (left, Right, Mid)

Nov 25, 2008

i need to create a random 3 letter prefix form eg. British Head Office, how would you pick letters out and compare the 3 letter prefix back to a column with existing prefix. and if u can help me even more how can i automate this method beacuase i for eg. get like 50 company names at a time and dont have time to do and check them 1 by 1 lol.

View 9 Replies View Related

Prefix Negative Sign To A Positive Numeric Character

Aug 21, 2009

The report generated from our co. software in excel have negative figures suffixed as "-" for ex., payable shown as 21373533-

- The value is treated as text in excel

- How should i Bring the negative sign for this type of data as prefix
when there is huge data and also in a columnar manner.

View 9 Replies View Related

Removing Prefix On Email Address To Leave Company Name In Field

Dec 7, 2009

I have a question regarding deletion and replacement in a new field. ie. A1 reads dave.jones@microsoft.com. I want A2 to read microsoft. What is the code to delete "dave.jones@" and ".com" to be revealed in a new field.

View 4 Replies View Related

Lookup Code Prefix From Another Page And Autofill With Alphanumeric Sequence

Mar 24, 2014

I'm looking to populate a series of sequential codes based on a code prefix.

Sheet 1: Master Code list
Column A = Lookup Value
Column B = Code Prefix

Sheet 2 - Results page
Column A - list of lookup values - sorted in value order - The number of occurances varies for each value
Column B - Results list

I want to populate Column B in the second sheet with a sequential code list for each different value in column A. So for the first value it would have the prefix then proceed numerically (Prefix0001, Prefix0002, Prefix0003...) then for the next value its prefix in sequence (2ndPrefix0001, 2ndPrefix0002, 2ndPrefix003...), etc

I'm wondering if there is a way to do this all in one step or else if there is a way way to number each occurance of the lookup value in the second page, in which case the code can be concatenated easily by a lookup of the code.

I suppose on the back of this there is another query - is there a way to concatenate a number where the format is 000# where the concatenated value will retain the leading zeros? I've been trying and it is stripping them out.

View 2 Replies View Related

Count Number Of Equal Cells With A Prefix In Col D And Insert Count In Col A?

Aug 7, 2013

I need to count the number of equal cells in col D beginning at the top of the column. The counted cells must begin with a text prefix of "Category:" without the quotes.

Some but not all of the cells in col D begin with a prefix of "Category:" without the quotes, followed by a word or words following the word "Category:" See examples below. All of the terms prefixed with "Category:" in col D are in alphabetical order. I need to count the number of identical cells in col D with the "Category:" prefix.

Examples of the contents of cells in col D with the "Category:" prefix are as follows:

Category: Adversity
Category: Answers
Category: Assurance
Category: Blessings
Category: Build
Category: Change
Category: Children
Category: Choices

Cells above and below cells with a prefix of "Category:" in col D are not adjacent.Cells above and below cells with a prefix of "Category:" in col D are separated by 3 to an undermined number of rows.

I need to count the number of equal cells in col D and insert the count in col A at the last equal term. For example, col A above would have 93, 1, 1, 5, 10, 8, 3, and 12 inserted into col A.

View 9 Replies View Related

Save Excel File As Another File Using Current Date As Part Of File Name

Oct 10, 2011

VBA coding for automatically saving an excel file as another file using the current date as part of the file name together with "32ga" as a constant add-in. I also what this macro to run at a particular time of the day let say 00:20hrs. The excel file i want to save as is always open . It has data that changes every 24-hrs.

View 1 Replies View Related

Export Data From A Template File To Total List File Using Macro In Template File

Dec 18, 2012

I have a template file for ordering trafolyte and steel plates. I have added macros to this template file. The existing macros do the following (shortly described):

Macro 1: clears order
Macro 2: update order date + send a read only file to the supplier of plates + save a read only copy of the file into one of three folders acc to info in one of the cells.

It's the Macro 2 I want to edit.

I want to add a "function" which copy a selection of data.column A to N from row 12 to 548 but only the rows where there is a value in column A.

Row 1 to 11 includes standard order info and Macro buttons.
Row 11 includes the heading for order data.

For everytime someone click on the Macro 2 button in the template file, I want the selection to be paste into the first "available" row in a "Total list" file.

The "Total list" file may have to be open (or a function to open, paste selection and then close the "Total list" file may be added)

File and Folder info:

To simplify suggestions, the following file and path info can be used (I can change to the correct later):
Template file name: template_order.xlsm
Template file location: \servershared emplate

Total list file name: total_list.xlsx
Total list file location: \servershared otal

Selection info:

The template file exists of a "general order info area" A1:N10
The column heading for order data is located at A11:N11
The selection to be copied is A12:N550 - But only rows where column A includes data (not empty).
(If the spesific order consists of 14 plates than there will be item no 1-14 in column A and I then I want to copy A12:N25 (row 25 will be item 14).

When I try to use record macro it looks like it only records what's happening in the template file - It doesn't record the pasting in the total list.

View 1 Replies View Related







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