I'm doing data clean up for a client & have run across data that contains a comma at the end. They've supplied it to me this way & from what I can see it just ends (there is no space after the final comma) IE:
Is there a way to remove the final comma in the fields where it's just "dangling" at the end but not remove it from the fields that don't contain the extraneous comma?
Obviously Find & Replace doesn't work because I need the commas to remain throughout the rest of the data. I've searched the boards & have not found a formula that works... I'm going a bit cross eyed at the moment & with thousands of rows to go through, I'd hate to have to remove the ending comma's one at a time!
The below function concats a range of cells by csv. How can I get it to remove the last comma in the string when it's finished?
Function SpecialConcatenate(rnge As Range) As String Dim r As Long, col As Integer
For c = 1 To rnge.Columns.Count For r = 1 To rnge.Rows.Count If rnge.Cells(r, c) "" Then SpecialConcatenate = SpecialConcatenate & _ rnge.Cells(r, c).Value & "," End If Next r Next c End Function
I currently have a macro that imports data from a web-based query then deletes column A from the query. I do this because I am using a VLOOKUP on the data and the VLOOKUP value would be in column B if I didn't.
The website has changed the format and now once column A is deleted, I'm left with a format of FirstName LastName, POS TEAM (i.e. Tom Brady, QB NEP). My VLOOKUP looks for FirstName LastName so I'm getting the "N/A" error now. I need to remove the "," and "POS" and "TEAM" from the imported data. This would be easy enough if the number of characters right of and including the comma was consistent, but it isn't. (Also, text to columns then CONCATENATE won't work because VLOOKUP looks at values, not formula results...)
Now I know the formula =LEFT(A1,FIND(",",A1)-1) works, but how would I incorporate this into the worksheet to keep the values in column A and not add additional columns to throw off my VLOOKUP.
Ideally I'd like a simple macro to add to my current macro to use the above formula, but I'm not sure of the wording.
Is it possible to take a list that is alphabetized in the following manner--Jones, Mary--, convert it to Mary Jones while also removing the comma after the name?
The =TRIM and =MID formulas that I saw in another thread both seem to convert the text, but they also leave the comma at the end.
This is a delima I cannot figure out. I had to create passwords for a website we are building. I have 3000 employee numbers has to be used. So what i did was took the first initial and middle initial and last initial and first 5 of the ID number. I did a comma delimiter to obtain all of the letters and numbers. example: ABC12345
My problem is none of the passwords work because when I imported the letters and numbers into the sheet it looks just like the above. However on review I cut and pasted back to notepad and the data looks like this:
"A B C 12345"
So its adding a tab in the password thats thats a problem, How do I remove this extra white space between each comma delimited digit? without having to manually delete it ?
I know that there is a way to remove or add subtotal for different fields, how to add subtotal only for the fields that have more than 1 value? I don't want to to subtotal for anything that has only 1 value.
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")? ´blank´or ´0´would exclude these numbers, i.e. would return "nlgahighstreeten"
I wish to get data after the last comma in each row (my data does not have any spaces). So my result would look like this:
432 4 43
I have 2 formula which I feel should do the work:
1. =RIGHT(A1,(FIND(",",A1))) --> However, this is only giving the last 2 characters in the result (including comma). How to fine tune it?
2. =TRIM(RIGHT(SUBSTITUTE(A1,",",REPT(" ",99)),99)) --> works nice and gives exact result. However, this was designed for extracting data from string with spaces, so not sure what trim and substitute would be doing here. How to make it simpler/ reduce its length by chopping off the un-necessary code?
I am working with large sequences of letters and I'm trying to put them into their own columns. I know about the 'text to columns' tool but the problem is my sequences are not delimited by anything. I would have to think the easiest way to accomplish what I want to do is to insert a comma, space or other delimiter between every letter, then use the text to columns feture.
I have approx 1000 rows in my spreadsheet. Each row contains one column which is a number. What I would like to do is list all these numbers side by side with only a comma seperating them. Just say the first 3 rows have the following numbers 10003, 10056, 100039. I would like to get the numbers to appear in one cell like this: 10003,10056,100039.
I did post a problem where I have a number like 123456 and I need to have Excel change it so that it puts a comma before the last two digits .. like so: 1234,56
I got a reply where I got the solution to use 0","00 and this works in Excel (using the custom format)
The only problem is that although the number changes in the cell to 1234,56 it doesn´t do so in the FX window and thus when I use the number to multiply it is actually 123456 instead of 1234,56 like it want it to be.
I have 1 column of people (LASTNAME FIRSTNAME). I was looking for a way to add a comma after the last name instead of just a space. i.e LASTNAME, FIRSTNAME. Is this possible?
I have a work book that has about 1200 entries. I'd like to grab everything that comes after the last comma or the last period in the cell. Can this be done?
I think this is a really easy question but I can't seem to think of an easy answer. I have 300 cells in one column I want to have combined into one cell, seperated by commas. I know I could just =A1&","&A2&","&... but this is not what I want to spend my afternoon doing. Is there a better way of doing this?
I have four columns of data. Column A is for the Model, B is for options, C is for color, and D is for Trim. What I need to do is for each model I need to have the options in column B to be listed down the page without commas. Each 3 code option needs to have it's own cell. In the below example there are 8 models with their options, color, and trim. I cannot have the options mixed up with the other models. Hope this makes more sense.
I have a UserForm with different text boxes, everytime I put a number with decimals (ex 100.23) on a Textbox and I want that number to be shown on a excel cell, VBA changes the "dot" for a "comma" so excel understands it as an integer number 100,23 (10023).
I want to set at my textbox,so that if user enter the number with comma instead of dot,the comma will automatically be changed into my default format(dot).for example,if user type in (86,5),the value will be converted to (86.5). I have read through the relevant previous thread regarding this matter and I wrote the function as below.It happens to be that (86,5) will change to (865.00),not as what it suppose to be.So can anyone correct my function below?
Private Sub txtdiameter_Change() If txtdiameter = vbNullString Then Exit Sub
If Not IsNumeric(txtdiameter) Then MsgBox "Numbers Only" txtdiameter = "86" 'default value' End If
I am an Excel Novice. I don't know very much at all about how it works, what formulas are or any of its intracacies. My job requires me to take information from an Excel file that is emailed to me.
I need to know in the simplest terms how to take the first column (which is last names) and add a comma to the end of each name (one in each cell) all the way down that column, before I copy and paste them, so they will read "last name comma space first name".