Delete String Before Last Colon If No Text After Last Colon
Nov 29, 2012
I found the following formula on another site that deletes all the text before the last colon (it deletes the colon as well)
=TRIM(RIGHT(M2,LEN(M2)-SEARCH("@#",SUBSTITUTE(M2,":","@#",LEN(M2)-LEN(SUBSTITUTE(M2,":",""))))))
Is it possible to modify it so that it only triggers if there is nothing after the last colon?
As you can see in the example below I have some notes entered by users and I would like to delete the ones where they didn't actually enter a note after the last colon:
11/05/2012 13:19:53 NEW MIKE : cld poe male sd cu not in till 3pm
10/18/2012 08:03:55 NEW HOSSEN : called no answer
10/15/2012 11:15:41 NEW HOSSEN :
10/12/2012 08:00:26 NEW HOSSEN :
10/11/2012 12:17:14 NEW HOSSEN : called no answer
11/14/2012 13:42:07 ACT MIKE : cld poe spk to cust sd cm back at 330
I would like to be left with just this instead:
11/05/2012 13:19:53 NEW MIKE : cld poe male sd cu not in till 3pm
10/18/2012 08:03:55 NEW HOSSEN : called no answer
10/11/2012 12:17:14 NEW HOSSEN : called no answer
11/14/2012 13:42:07 ACT MIKE : cld poe spk to cust sd cm back at 330
Link to article I found this formula in : [URL] .....
View 2 Replies
ADVERTISEMENT
Dec 30, 2009
I am a basic excel user and what I want is to be able to add in a time and have the colon automatically entered for me. For example, I want to add 130 and have it come out to 1:30, or 1215 and have it come out to 12:15. Seems easy to me but I cannot figure it out.
View 10 Replies
View Related
Oct 20, 2009
I need to find a way to enter times into excel without having to use a colon.
The data I need in the cell is the hour, the minute, and either AM or PM. No seconds, which I believe is why Chip Pearson’s time VBA procedure doesn’t work for me, and I don’t know enough about VBA to change it for my needs.
So for example, I need to enter in times like 10:09 PM or 12:40 AM or 2:33 AM.
All my times will be entered into Column D.
I have done a ton of searching and tried several different solutions, but none of them allow me to put in AM or PM. If I just put 1009 into a cell with Chip Pearson’s macro, it will display as 10:09 AM, which is great if I need it to be AM. But if I need it to be PM, and I enter in “1009 p”, it will display as “1009 p”, neglecting the colon and not displaying the time correctly.
Does anyone have a solution where I can type in a 3 or 4 digit number (233 or 1240) and either “a” or “p” after it, and have it display as 2:33 PM or 12:40 AM?
I use Excel 2007, if it matters.
View 12 Replies
View Related
Aug 21, 2009
I downloaded some data from an extarnal source to excel... the texts I get appear as 'TEXT' (mind the colons at start and end of TEXT).
However, in some of the cells the Start Colon is visible and in some cells it isn't (although it's there and can be viewed in the formula bar).
I want the start colon to be visible.
View 27 Replies
View Related
Oct 3, 2006
Replaced the period with a colon, 8.23 resulted in 8:23. I have since deleted the Add In. Now every time I enter a "." it is replaced by a ":". This happens even when I disable macros on the spreadsheet. I cannot see any VBA code.
View 2 Replies
View Related
Oct 25, 2007
I am making a template for our security kiosk log and I wanted to simplify it as much as possible. I found the "time mask entry" and imputed that into the vba code. It was working for awhile however stopped working a few days ago. I went back and copied and pasted it again and changed the range to what I needed and an error came up stating "unable to set the NumberFormat property to the range class."
Private Sub Worksheet_Change(ByVal Target As Range)
Dim vVal
If Target.Cells.Count > 1 Then Exit Sub
If Intersect(Target, Range("A1:A100")) Is Nothing Then Exit Sub
With Target
vVal = Format(.Value, "0000")
If IsNumeric(vVal) And Len(vVal) = 4 Then
Application.EnableEvents = False
.Value = Left(vVal, 2) & ":" & Right(vVal, 2)
.NumberFormat = "[h]:mm"
End If
End With
Application.EnableEvents = True
End Sub
View 9 Replies
View Related
Oct 23, 2008
I have been using the following formula's to trim some information that's separated by a colon, such as Pioneer Clinic:Dave McAfee...so that I have a column with Pioneer Clinic and a column with Dave McAfee:
=LEFT(G5,FIND(":",G5)-1)
=TRIM(RIGHT(G5,LEN(G5)-FIND(":",G5)))
However, now some of my data is separated by two colons! AVM:Pioneer Clinic:Dave McAfee. the formula for separating this so I still have two columns of Pioneer Clinic and Dave McAfee?
View 5 Replies
View Related
Jan 12, 2006
Is there any way that I can format a cell to insert a colon three spaces to
the left from the end of any group of numbers that I type in the a cell?
Examples 9:15 10:15
View 12 Replies
View Related
Jul 7, 2014
I have been sent a spreadsheet that was populated from another system. I need to run some VLOOKUPS but the cell that I need to compare has a ' in front of the text/number eg 'VB123456. I have found a thread on how to remove it for a number but it does not work with letters.
View 6 Replies
View Related
Jan 24, 2013
I have a long list of names
Doe, John;Doe Jane; etc..
Is there any way to have Excel separate them into individual cells?
View 2 Replies
View Related
Nov 8, 2012
ColB is a time of day in 4 digits ****
I need it to be **:**
How do I get the colon in the middle?
View 1 Replies
View Related
Oct 28, 2007
I have used the format [hh]:mm in a cell for 24 hr clock calculations. Why do I have to enter the numbers with a colon when I populate the cells? Is there a way to set it up so I just type in the four numbers and the colon between the hours and minutes populates itself?
View 9 Replies
View Related
Mar 4, 2012
What is the best way to concatenate with a semi-colon across multiple cells in excel. The one kicker is I only want to concatenate where the cell is populated.
If I write a simple Concatenate or combined columns, if a cell is blank I get the multiple.
View 1 Replies
View Related
Nov 30, 2003
Is there a way to format cells so 24 hour time may be input without the colon, as an example 1425 instead or 14:25? We can do it in Access. One would think it possible in Excel, yet I have not discover how if indeed its possible.
View 9 Replies
View Related
May 6, 2009
Is there a way to enter a colon into a standard number to create a value that can be formatted into a 24 hour time value? eg a time is listed as 1345 with a general number format, and I want it returned as 13:45 witha custom format of hh:mm. Other than creating a table and using a vlookup function
View 3 Replies
View Related
Oct 4, 2011
i have encountered a problem which happens when you write data that contain : in an excel sheet (i use excel 2010)
for instance if i enter to one of the cell 45:58 excel sees it as 01/01/1900 21:48:00 when i try to get the information by using a function i will get the wrong data for example typing in the different cell LEFT(Cell,5) will result 1.908
(i receiving the data from an outside source in this way and i need to make analysis)
i have noticed that the first 2 digits (21 in the example) are related to the number i have choosen in a 24 hour cycle for instance
24:58 will result 01/01/1900 00:58:00
26:58 will result 01/01/1900 02:58:00
48:58 will result 02/01/1900 00:58:00
View 7 Replies
View Related
Jun 3, 2014
I am looking for VBA code that will save Excel 2010 files in semi-colon delimited format without having to chage the universal language options.
View 1 Replies
View Related
May 15, 2014
I have a column of data with letters in each cell, no numerical, only alpha. Now, some of those cells contain the letters "adj sub" as part of the text string in each cell. "Adj sub" is always at the beginning of the text string. As an example, a cell will look like this - "adj sub mhm". I want to delete rows whose cell description does not contain "adj sub" as part of the text in the cell.
View 5 Replies
View Related
Aug 15, 2014
I am trying to delete part of a text string for a range of cells. The code I have so far deletes the first set of letters but is looking in every cell in the range.
Ideally I would like it to only look in the cells of col B where there is data then only delete the first 10 letters if the cell begins with "Service ID"
Sub DeleteServiceID()
Dim c As Range
For Each c In Range("B1:B1000")
c.Value = Right(c.Value, 10)
Next c
End Sub
View 4 Replies
View Related
Mar 30, 2009
I am looking for a formula to delete information from the middle of a text string. I have ~ 1,000 lines of data. Each text string is composed of the same way. The data I am looking for is two parts of the string (1) all the text up to and including the first “%” character (2) the last six characters.
Raw Data
CARDINAL HEALTH 5.5%13CARDINAL 5.513 CARDINAL HLTH 5.5 061513
UST BILL 0%09US TREAS BILL 0%09 UST BILL 0.0 092409
WORLD SAVINGS 4.125%09WORLD 4.125%09 WORLD SVGS 4.125 121509
JP MORGAN 5.375%12JP 5.375%12 JPMORGAN CHS5.375 100112
Desired Result
CARDINAL HEALTH 5.5% 061513
UST BILL 0% 092409
WORLD SAVINGS 4.125% 121509
JP MORGAN 5.375% 100112
View 2 Replies
View Related
Oct 19, 2012
I need A VBA that will delete a cell if it contains a specific text string
As long as the cell content is deleted, I can do the rest that needs to be done.
View 4 Replies
View Related
May 21, 2008
I have an excel file, and on some rows, the "B" column contains the text " Total:" (it does have a leading space). I would like to loop through the first 200 rows (maximum length of the file) and delete all the rows that contain " Total:" in column "B". I have tried:
For i = 1 To 200
range("B" & i).activate
If range("B" & i).value = " Total:" Then
rows(activecell.row).select
selection.delete shift:=xlUp
End If
Next i
When I step through that code, it just skips over the IF function as if B1 does not equal " Witness:"
View 3 Replies
View Related
Jun 13, 2013
Working with a scheduling report and trying ultimately to get it down to a line item report with the associate information and their earliest start and latest end for the week. Already made a lot of fixes to the formatting involving junking empty cells and trash data, but running into a road block on some of the trash data.
Here is the format of the report at this point. Names have been changed to protect the innocent.
Agent: 2366 Bacon, Kevin
Date
Start
End
[Code].....
So what I need is something that will iterate through the report...such as an while and find the cells in column A that start with "Agent:" It needs to compare that cell to a stored value to see if this "Agent:" is a repeat. If it is then it needs to delete that row and the next one and shift up. If it is not then it overwrites this "Agent:" with the previous one in the stored value and continues the while.
I know what I want to do...but not shure on the code cause I am not great at VBA.
Oh...if it matters probably need to allow for about 10k line items to iterate through...right now report is at 6k...but allow room to grow.
View 6 Replies
View Related
Jan 31, 2008
Find a short text string in a column of longer text strings and when that short text string is found return the longer text string that matches.
View 3 Replies
View Related
Apr 28, 2014
I am currently using this macro for deleting a row if a string is found:
[Code] .....
But I would like to be able to not delete that row, but also to delete the 13 row above that row, including that row too.
ROW 1
ROW 2
ROW 3
ROW 4
ROW 5
ROW 6
ROW 7
ROW 8
ROW 9
ROW 10
ROW 11
ROW 12
ROW 13
ROW 14 - NO MONEY
All this from No Money up to Row 1 will be delete, and loop.
View 3 Replies
View Related
Oct 23, 2013
I want a macro to look at column G and if a cell in column G does NOT contain "Test Case" anywhere in the cell then delete the row. So for example G5 might be "Test Case/Others" - I would not want this row deleted.
View 3 Replies
View Related
Dec 21, 2012
I have some columns in the excel file:
/path1/xyxxx/cccccc/filename12.txt
/path1/bxgdgg/gfdfacc/filenameeee8.txt
/path1/tttwrw/ccefecc/ddddd/filename56.txt
And I would like to delete everything before the LAST slash(just filenames)
filename12.txt
filenameeee8.txt
filename56.txt
View 2 Replies
View Related
Apr 23, 2013
I trying to search for a string in Excel and then delete that row. The code below will do that but I am also looking to delete the next row line out as well. .
Dim ws As Worksheet
Dim lRow As Long
Set ws = ThisWorkbook.Sheets("DSS")
[Code]....
View 2 Replies
View Related
Feb 1, 2014
VBA code to delete all rows that have the day string of Wednesday
The weekdays are in column C2:C?????
View 8 Replies
View Related
Dec 11, 2007
I have data (strings) which looks like this:
000000000001000
000000000392000
000000000003000
no I want to write a routine which delets all zeros from left to right untill the first "normal" number appears.
Result:
1000
392000
3000
View 9 Replies
View Related