I'm trying to speed up the creation of an input file that has a set character length but the inputs have variable lengths. For instance the identifier can have a string length of 7 or 8 depending upon the type.
BTW I've also tried using space(1) as opposed to " " in the loop.
I need to some spaces to the end of a string to make it up to 36 chars.
The original string can vary in size based on the courier name. i.e. : business direct invoice 40617 = 29 chars i.e. : TNT post invoice 4061755 = 24 chars
Can someone point me in the right direction to be able to concat' some spaces on the end to make it up to 36 chars.
I need to take 12ABC1234512345 and turn it into 12A BC 12345 12345 with a vba macro. I've made a formula that works but in this situation a macro would be more ideal.
I am looking for this for some time. Is there any formula (not vba) to count that how many occurances of spaces are in a text string, spaces could be more than one between the words.
How can I count the number of gaps (spaces) of a string? (Adding one we have number of words!). I need to save the position of each gap (space) on a array. How can I do it? With InStr()? The variable (string) that i'm working is GlbTargetRange.Value
I am trying to get rid of the spaces at the beginning of text that is the result of a download from a reporting software package. I am using the Trim function but it does not work. It seems that it has something to do with the formatting. The first set of data of the download looks as follows: SalesSales BreakdownSolenaceousCucurbitsLargeSeedIf I overtype the text in exactly the same way (thus keeping the spaces at the beginning), the trim function works. But this is not a practical solution.
The type of the cells is "2". I have tried copying the data as values to a different workbook but this does not help either.
I've found several posts about returning variable substrings that dealt with one or two spaces, but I have not been able to find anything that is for multiple spaces. The number of characters before the substring will remain constant.
For example:
Income from transmission agreement - 83 subs @ $0.44
In this case I need to extract: 83
Income from transmission agreement - 10,312 subs @ $0.50
I have a list in Column A" Job List" (the amount of entries will change based on job openings). There are some cells that are blank; randomly throughout. I need to create a new Column B "Current Jobs List" with no spaces. I have to do this weekly and each time I update my "Current Jobs List" from the new data in the "Job List" without any spaces.(I do not want to just do a filter) .
I have a udf that returns a string to the cell. The string is made up of multiple string "objects". What I am wondering is if I can set the font color of certain objects so that when the final string is built and returned, the font of those portions is set.
Ex. of simple idea (this is not actually my code, just a way to illustrate. I realize there is no point to this UDF):
VB:
Function StringReturn (Str1 As String, Str2 As String, Str3 As String) As String StringReturn = Str1 & Str2 & Str3 End Function
Now what if I wanted Str1 and Str3 to be blue, and Str2 to be red for example. So that when the UDF calculates it would return: Str1Str2Str3
Wondering if it is possible to generate a random 4 digit number based off an alphanumeric string?
Example;
Cell A1 has 123XVF1234 Cell A2 has 321AFW4321
In B1 I would like to have a 4-6 digit number that is generated based on the alphanumeric data in Cell A1 (and so on down the list). If that is possible, I would also need to be able to convert back the 4-6 digit number back to its original alphanumeric value
Example;
If B1 returns 643562 it would need to be able to be converted back to 123XVF1234
In sheet1 I have a simple database consisting of 5 columns of data
Column A : Name ie James Jones Column B : payroll number ie 123456 Column C : shift times ie 1245-2124 Column D : job title ie floor Column E : comments ie A/L or 0600-1500
what I would like is some code that will go down Column E and if a 'time string' ie 1300-2130 is found then copy this string and paste into corresponding value in column C. If a text string is found ie A/L or Sick or anything like this then ignore and move onto next cell, loop this until all cells in column E have been checked.
I need to create a string of all the Acc Number but I dun not wan any repeat of the same Acc number in the String . The number of Acc number to be put in the string may varies sometimes. It may varies from 3 to 1000 or more . Is there a way to write a general formula to create such string?
I have a situation where a word (in this case "Restaurant") is misspelled in a list of about 78,000 location names. The location names are in one column, and the [misspelled] word "Restaurant" is anywhere between the first word of the string, to the last, with any amount of alphanumeric/symbol characters between. For example:
Alice's Restaurant Alli's Restaurant & Bar Alexis Restaurant of Waukesha Amigo's Mexican Restaurant #2
I want to replace any misspellings of the word with correct, but since the list is so long, and the way the word is misspelled varies so much, going through manually is entirely too time-consuming.
Some of the variations I've seen so far are Resta, Restau, Restaur, Restuara, etc...
Is there a way to search and replace cells that contain the text in any location of the string? Specifically, where ever there is JUST "Restau", replace with "Restaurant", regardless of where it is in the string? This way, trailing text is not deleted or manipulated, i.e. "Alice's Restaur and Bar" will change to "Alice's Restaurant and Bar".
I am creating a small function that should create a new login for future users. The login is 7 characters long. Spaces in that name (in cell A1 eg) should be removed? But how do I do this?
How do I remove the space in the name: "De Castro Imelda". Apparently the function TRIM does not help me much. Either I use the wrong function, or I my syntax is not good...
I have a range of cells in column A... it's called SPACE. The code should be if the value in each cell is equal to "1" and select the NEXT row and INSERT an empty space.
Then keep going down the range to find the next "1", and add a space... but if it's not equal to one, keep going. Essentially I'm grouping data, with new data sets being indicated by the "1", and need to put an empty row in between the data sets.
I have a cel that has about 100,000 phone numbers and at the end of some and before sum, there are spaces added to end. is there a formula, or a way to take everything away except for the 10 digit number?
I have an instance where I have a list of numbers in different rows with different amounts and I want to add up the last 6 numbers, they're all in the same column however they're not all in consecutive rows.
Also, the gaps between the rows is not consistent.
The example below explains what I mean (I've add numbers in between so you can see the varying gaps, but they're actually blank cells)
I am trying to remove spaces in front of a number (currently formatted as text)
I have tried "Text to Columns", "Trim", and other suggestions in previously threads.
I have copied bank statement amounts from an e-mail and the $ amounts have one Space in front of them. When I use the Trim function, and then a paste special, I still cannot get rid of the space, and so cannot add up the amounts in this column.
Ex:
*7 Dec 2007*DEPOSIT*3,917.63 *7 Dec 2007*DEPOSIT*1,890.58
I've got a problem with a report that we need to manipulate in Excel. the report details the man hours each of our analysts has spent on calls and reports in the following format HH:MM:SS. However, the report comes out with a space after 'SS', so I need to trim this in order for excel to calculate total and average fix times. Cells are formatted to custom [H]:MM:SS.
With over 200 records requiring trimming per report, is there a formula that I can apply to this? I have tried =trim("Cell number") but this doesn't work.
I have columns that are defined with these width's: A - 9B - 1C - 12D - 12
I need a macro that would add spaces to the right of the cell if the cell does not have number of characters of the lenght of the column width.
For instance: Cell A1 has 5 characters so it would need 4 spaces. Cell A2 has 7 characters so it would need 2 spaces. Cell B1 has 1 character so it would NOT need a space. Cell B2 has 0 characters so it would need 1 space.
I have a sub that works just fine, but I need to test it for blanks.
Sub AddToComment() Dim rCell As Range Dim cCom As Comment Sheets("Support Detail").Select With Range("e5") .ClearComments Set cCom = .AddComment End With Sheets("Sheet1").Select For Each rCell In Range("a4:a23") cCom.Text Text:=rCell.Text & " " & cCom.Text Next rCell End Sub
I only have 1 line of test in the a4:a23 range - so I'm getting 19 spaces before the text in the comment. If the cells within a4:a23 are blank, how do I ignore them? I'm not sure how to interpret this code, so I'm sure it's probably easy:
I am trying to change values of some sheets in a worksheet, but the worksheet has spaces in the name. Is it possible to use that with spaces? I am also having the same problem where I am trying to copy some data between 2 different windows, and 1 of the file name has spaces in it, so I cannot use that either.
I have a spreadsheet which has "Employee: [agent 1 name]" in column A and it may or may not have the word "Break" in the same column before it mentions "Employee: [agent 2 name]". The amount of data between agent 1 and agent 2 varies and am needing code which will insert a row above "Employee: [agent 2 name]" if "Break" is not found, and add the word "Break" in column A on the inserted row. I would need this to loop through the spreadsheet until all 100+ agents have been searched.
I'm also needing this done for the word "Meeting" and would insert a row 2 rows above the next agent.
I'm using a userform to create a new sheet. The form already creates the sheet and names it what was typed into the userform. Now I want it to place that variable in a cell along with a string. the following code will place the variable from the form (tbname) into cell b5.
I can't use the "" sign as delimiter to separate them into different columns because the age,city,name and height fields are in random positions on different cells.The good thing is person's name will always come after "name" string, age is alwals followed by "age" string, so it cannot be like nameheight40Michigan180
I think the following would be the easiest method(not for me tho).If on B1 I had a formula that said "find the string "name" and write anything after it until you reach the next "" character".On C1 field I could have a formula "find the string "age" and write anything after it until you reach the next "" character.On D1 I would have the same for "height" string,then on E1 for city string.
My question is somewhat similar to this one Extract A String Between Two Characters
Formula which outputs the data between 3rd and 4th instances of the "_" character.Can we substitute "3rd and 4th" with a specific strings like "age" or "height" ?