Need 2 VBA Codes For Names
Oct 2, 2009
I have names in the following format in Column A: e.g.
Mr. Doe SmithSmith DoeJr. Doe SmithJr. Smith DoeMiss Abc XyzMrs Abc XyzXyz Abc
I want a VBA code that would turn all different formats of names listed above as:
Doe Smith
Abc Xyz
I also want another code that would turn above formats as follows: (by the last name)
View 16 Replies
ADVERTISEMENT
Jan 29, 2012
get utf-8 string variable from userform.textbox?
when i try to get it, it shows me "?"..
is there any dll file for vba to add comments and names in UTF-8 codes?
View 1 Replies
View Related
May 7, 2014
I've written a procedure that loads a list of country selections in a dropdown (see attached/vb editor/ThisWorkbook).
The problem is the valid values for this column need to be just the two digit country codes, not the country code +dash+country name. The reason the dropdown selections include both the two digit country code and the country name is because most users will not know the two digit codes. Presenting the selections in this fashion will make t much easier for the user to make the proper selection.
So here is what I need: When the user makes a selection from the dropdown list, the resulting value needs to be the two digit country code only. Is there a way to incorporate this formula .... =MID(B2|1|2) ... in the vba procedure which runs after the user makes a selection? Or, is there another way to accomplish this?
Example_COO.xlsm‎
View 10 Replies
View Related
May 5, 2006
I'm trying to convert various codes from one column of an excel spreadsheet into different codes in another column. I was able to accomplish this with "If" statements, however I'm only able to string together seven of these statements in one command. Is there a better way to add formulas for more than seven conversions? Below is a copy of what I've done so far with the seven converts:
=IF(ISNUMBER(SEARCH("WARN",J2)),"Warning",IF(ISNUMBER(SEARCH("PSSNAP",N2)),"Sales",IF(ISNUMBER(SEARCH("WARN",L2)),"Warning",IF(ISNUMBER(SEARCH("2699",L2)),"Warning",IF(ISNUMBER(SEARCH("4004",L2)),"Warning",IF(ISNUMBER(SEARCH("2036",L2)),"Warning",""))))))
I want to add about 15 more codes to convert within this formula but it's maxed out in the format I'm using.
View 3 Replies
View Related
Jan 13, 2014
I have a long customer listing, names 5 to 36 characters and several with their location in the name as well as a few common duplicate names. I am trying to produce sheet where the customers name once selected opens in the customers spreadsheet and data can be added/amended for sales etc.The lists are not in alphabetical order as when created a customer number is automatically allocated. My aim is just to type in the first letter of the name and the dropdown appears the customer is selected and their card appears. I have tried data validation, lookup, vlookup, Dropdown and Match/find. they only return the first record found and no sign of any others. Find returned all instances of the letter appearing in every name.
View 9 Replies
View Related
May 7, 2012
Can I create data validation list of the names created in the name box or of the sheet tab names?
View 5 Replies
View Related
Oct 15, 2013
Code:
Sheets(Array("Sheet 1", "Sheet 2")).Visible = False
How do I convert the above to using Sheet Codes Names, Sheet1 and Sheet2?
Want to ensure my code will work if the user changes the sheet name.
View 2 Replies
View Related
Jan 4, 2013
I have a worksheet with many tables that I use in formulas.
I like tables for a couple reasons, one being the ability to insert/delete rows without affecting the rest of that worksheet row.
Also, automatic copy of formulas/formatting is great.
But, what I really like about tables is the ability to use the naming conventions in formulas.
Problem is when I save this worksheet, after I close it and open it back up, all table references in my formulas have been converted to cell references.
Example:
Code:
=IF((SUMIF('Quote 1'!$M$28:$M$43,">"&'Quote 1'!$J$57:$J$60)*'Quote 1'!$G$57:$G$60)+(COUNTIF('Quote 1'!$M$28:$M$43,""&'Quote 1'!$J$57:$J$60)*'Quote 1'!$G$57:$G$60)+(COUNTIF('Quote 1'!$M$28:$M$43,""&tblOSSRV[Min Order Cost])*tblOSSRV[Cost / Part])+(COUNTIF(tblFam[[#Data],[Qty by Factor2]],""&tblOSSRV[Min Parts Per Line])*tblOSSRV[Cost / Part])+(COUNTIF(tblFam[[#Data],[Qty by Factor2]],"
View 4 Replies
View Related
May 1, 2008
Two part question:
1) I'm relatively new to arrays, but what I need to do is generate a list of file names and the sheets within each one. I would like to use an array for this, but since I don't have much experience.... well....that's why I'm here. Can someone point me in the right direction?
2) And the second part of this.... I was planning on using the FileSystemObject to determine the files in a selected folder and loop through that list of files, opening each one and harvesting the required info (file name and all sheet names). Should I use the FSO or is there something built into Excel that might be better (and also limit the number of dependencies for this little "project" of mine).
View 9 Replies
View Related
Feb 25, 2011
Is it possible to produce a list on a new worksheet of all sheet names and their their internal names within a workbook?
If so I would like the tabbed name's to begin in say A2 with the corresponding internal name in B2.
View 3 Replies
View Related
Aug 26, 2008
I am using Excel 2003 and Windows XP.
I have been given a list of my firm’s target clients (in excel) and an opportunities report (exported into excel) from our CRM system, which lists all the opportunities (i.e. opportunities to sell/provide products/services) that have been created for each client. Some of the column headings in the opportunities report are as follows:
Client; Opportunity ID; Opportunity Name; Opportunity Description; Created by; Date Created etc.
What I need to do is lookup each client, from the target clients listing, in the opportunities report to see whether an opportunity has been created; and if so, return the row of values (i.e. the Opportunity ID; Opportunity Name; Opportunity Description; Created by; Date Created) for that client. The result will be placed next to the name of the client in the target client worksheet.
I have a couple of problems. Initially I tried to use the VLOOKUP function to lookup the client name in the opportunities report and return the Opportunity ID (I then planned to use the same formula to return values from the other columns); however, as the client names in the target client listing were not always written the same way as they were in the opportunities report, the formula often returned #N/A. The formula I used was
=VLOOKUP(A8,'Opportunities Report'!A2:F51,2,FALSE)
So for example, the first client that I was looking up was written as “ABC Ltd” but in the opportunities report it was written as “ABC Limited”.
My second problem was that for some clients, there were multiple opportunities listed in the opportunities report. Where this was the case, there was a separate row (repeating the client name in the first column) for each opportunity created. I think that was messing up my VLOOKUP formula as well.
Is there a way to look up the client name, from the target client listing, in the opportunities report even if it’s slightly different and return the row of values for each opportunity created for that client on a separate row?
View 9 Replies
View Related
Sep 1, 2009
I have a list of names in a single cell. They are all seperated by a comma, then a space. Example would be: John Smith, Steve Wilson, Wallace O Malley, etc. What formula could I use to pull out the names individually, starting from the farthest right?
View 2 Replies
View Related
Feb 24, 2014
I'm trying to sort out a list of names from a website that publishes names in the following format:
DOE John
VAN GOGH Vincent
DA VINCI Leonardo
NADAL PARERA Rafael
JIMENEZ RODRIGUEZ Miguel Angel
What I'd like to do is get the names in the following format
John Doe
Vincent Van Gogh
Leonardo Da Vinci
Rafael Nadal Parera
Miguel Angel Jimenez Rodriguez
Basically all the last names - which are all capitalized - would be moved to the end of the text string. Of course any leading spaces should be removed and I guess using the Proper() function, all capitalized words could be capitalized in a standard way.
I found the following function, here: [URL] ...
but what it does is just take the capitalized words and separate them into a separate cell, which is not all of what I want.
View 1 Replies
View Related
May 14, 2009
create a script that will replace the names in column A on sheet1 from a Master sheet in the same workbook?
The problem is that different users are entering data on sheet1 col A in different ways example someone may enter Johnc or John C Or John What I want is for something to run down col A on sheet1 and look for the like name on the master sheet if the name matches then do nothing but if the name is like another name on the master sheet then replace the name if they are almost alike.
View 11 Replies
View Related
Jan 22, 2014
I need to create a function that selects 4 names randomly from a list of 15 names and displays the 4 randomly selected names in the one cell. Also, you cannot repeat the same name in that cell, (i.e. bob cannot be selected twice in his group of four)
View 1 Replies
View Related
Dec 10, 2008
I need to make this macro read FOLDER names instead of FILE names. When I posted this question yesterday to get this macro, I wasn't told that each file in its own folder. I need the folder names now.
_____________________________________
Sub test()
With Application.FileSearch
.NewSearch
.LookIn = "C:Ford"
.SearchSubFolders = False
.Filename = "*.*"
.FileType = msoFileTypeAllFiles
If .Execute() > 0 Then
For i = 1 To .FoundFiles.Count
Cells(i, 1) = .FoundFiles(i)
Next i
Else
Cells(i, 1) = "No files Found"
End If
End With
End Sub
View 9 Replies
View Related
Feb 26, 2009
I have two columns, zipA and zipB. There are over 7000 rows and I need to calculate the distance between zipA and zipB for each row (so the result should be over 7000 rows of distances (in miles)). I posted this in the programming board because I figured it would require some. I don't have any add-ons.
View 14 Replies
View Related
Jun 9, 2013
Just starting to learn VBA. I have the 2 following codes.Can they be combined into 1 code.I have 2 buttons one say hide rows and the other button says unhide rows....can 1 button be used and when the rows are visible the button says hide rows and when the rows are hidden the button says unhide rows
Sub hiderows()
ThisWorkbook.Sheets("sheet1").Rows("3:12").Hidden = True
End Sub
Sub unhiderows()
ThisWorkbook.Sheets("sheet1").Rows("3:12").Hidden = False
End Sub
View 6 Replies
View Related
Feb 24, 2007
At my last job we purchased a zip code addin from spheresoft that could give you a distance between two distance ie: =ZipCodeDistance(zip1, zip2)
This worked well but I am now at a new job and wondering if there is any data out there that could help me build my own sheet. I just need California
I have both zip codes now just need the distance, I could sit down, drink a ton of coffee and enter zip codes all night into Mapquest but am hoping for a better way.
View 9 Replies
View Related
Mar 22, 2007
I have a spreadsheet containing data in coloumns A to L.
Where all the codes in column B are the same then a border must be placed around all the codes that are the same i.e the border must start in Column A and end with column L.
provide me with the code the will put borders around the codes in column B that are the same ...
View 9 Replies
View Related
Apr 1, 2008
I have written a VBA code.
I thought I could just save it as an ADD-IN and then have my colleagues to add it, but that does not work. The macro will be stored in a seperate workbook and that is not what I want. I want them to be able to open any workbook and want them to be able to run the macro. I.e. everytime they open a workbook the macro should be available and be ready to run.
View 9 Replies
View Related
Feb 10, 2009
VLOOKUP returns incorrect results when comparing zip codes across worksheets. I think the problem could be caused by 2 things:
1. There are duplicate rows in the lookup_value range because each represents an individual and needs to remain a duplicate to show whether there are multiple individuals from the same zip. In these cases, VLOOKUP only returns the first matching zip from rows containing duplicate zips. (See 07042 in worksheet 1 of the file linked below.)
2. Zip code format is not being treated as a number during sort. Do I need to use a different format during sort? Don't want to lose the leading zeros on the zips.
View 9 Replies
View Related
May 28, 2009
I am looking out for a macro by which i can combine multiple PDF's into one through excel using vba codes.
Please note that:
> all these PDF's are in one folder
> the code needs to be dynamic (i can have an option to combine selected PDF's
> i am working in excel 2007
> i have acrobat 8.0 installed
View 9 Replies
View Related
Oct 23, 2009
I have a database where each subject has data for 4 days and a number of different codes each day. I am looking to calculate how many different codes they have on day one, how many unique codes they have on each subsequent day and the sum of all these codes.
For example, in the data attached:
Subject 10002 = 2,1,0,0 (3)
Subject 10005 = 3,1,0,0 (4)
Subject 10009 = 3,1,1,0 (5)
View 12 Replies
View Related
Nov 17, 2008
I have an excel workbook with two worksheets. The first worksheet contains a lot of data with more than 20.000 rows and 20 columns. The important part is that there are two different columns (column F and I) containing codes of items. What I would like the macro to do is the following:
write codes of items in the second worksheet column B under each other. I would like the macro to lookup the codes from this column in the first worksheet (column F and I) and if it finds then display in worksheet 2 column C the column in which found it on worksheet1. So basically I write on worksheet2 column B many many codes and then I press a button to do a search and displays next to the items (in column C) if it found the code in worksheet1 column F, or column I or both, or did not found it.
View 2 Replies
View Related
Jun 8, 2009
I have the following seven codes used to fill a ListBox with data retrieved form a range (DACNRange).. they are almost the same .. the only difference between them is the range column number (highlighted with red). Instead of these seven similar codes, Can we create a general code replaces them all?
View 2 Replies
View Related
Jan 12, 2009
City, state 29785
city, state 29767
city, state 29719
I need the zip codes to be pushed to the next column, to column 'D' to be exact. I already tried using the "text to columns" function. I selected "delimited" file type and used "2". it pushed the data to the next column everytime there was a 2. The problem is, there are 2's in the middle of the zip code sometimes. Also, it gets rid of all the 2's. Also, I can't use the "fixed width" option because there are some city/states that have more letters in them obviously, so the column is not a perfect width.
View 8 Replies
View Related
Dec 30, 2012
I am just thinking if there is a way to delete or hide all vba codes as I dont want readers to see them.
View 4 Replies
View Related
Apr 18, 2013
I have a spreadsheet that has Zip Codes by Service Days, and then I have another Spreadsheet Zip Code Ranges and the Zone they fall in. I want find the Zip Code associated within that Zone for the Zip Code. I listed some data below.
Zip Code Spreadsheet
State Destination Zip Service Days
NY 12095 2
Zone Chart
From Zip
To Zip
Zones
[Code].....
View 5 Replies
View Related
Jan 3, 2014
How to merge two codes too allow (2) functionalist
I have a rather complex situation that I'm not sure how to handle. First let me provide some background on what I have accomplished thus far.
Background: I have an excel file with two worksheets. Worksheet two, named Data, is where all my data is located. It begins with A1 going through JC4 (A1:JC4). However, for the purpose of my project the data I'm concerned with starts on E1 through JC4. Also, every other column is formatted with ="".
I have used the following sequence of commands, obtained from a website, to make it much simpler to define name ranges:
Select the worksheet "Data"Select cell A1Select the current region using CTRL + SHIFT + 8Press CTRL + G to bring up the Go To dialog boxClick on the "Special" button to bring up the Go To Special dialog boxSelect "Constants" and press the ENTER key (or click the "OK" button)Now define the Named Ranges using your selection by pressing CTRL + SHIFT + F3Excel will ask you to "Create names from values in the:" Make sure only "Top row" is selected, then press the ENTER key (or click the "OK" button)Check that the correct named ranges have been defined by opening the Name Manager with CTRL + F3 While I have defined named ranges with the above steps, this is not the same as a dynamic named range. At least I don't think its the same thing.
I have also protected the worksheet to prevent anyone from changing the formatting. Note: the top row of each column that contains information has been designated as the name for the information that comes after it (see step 8 and 9 above). Now, my first worksheet is where I have created conditional drop down screen by using data validation. The drop down screen are conditionally formatted. Meaning depending on the selection from the drop down screen in cell E27 will determine the list on the drop down screen in cell F27, and so on through cell H27. Furthermore, the drop down items on:
1) Cell E27 (in the first worksheet) are located on the second worksheet in cells E1, G1, I1, K1. Each of those columns have a list of items that fall under them.
The lay out of the data worksheet is too combursome to list out, but I have attached a picture. IF you follow the data you will see some of the information is listed in two cells, for conditional formatting purposes. I have also attached a picture of worksheet 1 with the drop down screens.
Code 1: (allows the selection of multiple items in one cell separated by a comma)
Developed by Contextures Inc.
' www.contextures.com
Private Sub Worksheet_Change(ByVal Target As Range)
Dim rngDV As Range
Dim oldVal As String
Dim newVal As String
Dim lUsed As Long
[code]....
Code 2: (allows for manually adding directly to the drop down list a new item that is not on the list. It will then add it to the list after the hard entry directly to the drop down menu). Remember the list will be on the Data worksheet, worksheet #2. The drop down menus are on the first worksheet).
' Developed by Contextures Inc.
' www.contextures.com
Private Sub Worksheet_Change(ByVal Target As Range)
On Error Resume Next
Dim ws As Worksheet
Dim i As Integer
Set ws = Worksheets("Lists")
[code]....
I have added the first code by right clicking on the worksheet and viewing the code, then adding Code 1. It works beautifully.
What I'm trying to figure out is how to add Code 2 to the mix with out unding Code 1. I'm trying to either combine the codes or insert the second code without disrupting Code 1. Remember I have already created a defined name range in my Data worksheet for all my columns/information. I tried deleting Code 1 and only inserting Code 2 but it didnt work. Code 2 does not work based on how I have designed the formatting. How do I apply Code 2 to what I have done thus far? Can this be done by bypassing a dynamic name range, since I have already assigned a defined name range? I want both codes to apply to Columns E, F, G, and H on the first worksheet.
View 1 Replies
View Related