Hey Basole, The code works perfectly fine with the small data sample I gave you. However, after some further testing, I noticed that it does not work with single digits that sometimes appear. Keep in mind that the single or double digits may have a decimal and can be positive or negative. A minor modification ? Impressive. Thanks.
On Wednesday, 18 December 2013 07:47:40 UTC-5, Basole wrote: > 'Hi Bill, I redid the code, see if it works now: > > > Sub SplitRange() > Dim FirstPartM As String > Dim SecontPartM As String > Dim FirstPartH As String > Dim SecontPartH As String > Dim i As Long > Dim Lastrow As Integer > Lastrow = Cells.Find("*", [A1], , , xlByRows, xlPrevious).Row > i = 1 > For i = i To Lastrow > If InStr(Cells(i, 1), "+") > 0 Then > FirstPartM = Left(Cells(i, 1), InStr(Cells(i, 1), "+") - 1) > SecontPartM = Right(Cells(i, 1), Len(Cells(i, 1)) - InStr(Cells(i, 1), > "+") + 1) > Cells(i, 2) = FirstPartM > Cells(i, 3) = SecontPartM > Else > If InStr(Cells(i, 1), "-") > 0 Then > FirstPartH = Left(Cells(i, 1), InStr(Cells(i, 1), "-") - 1) > SecontPartH = Right(Cells(i, 1), Len(Cells(i, 1)) - InStr(Cells(i, 1), > "-") + 1) > Cells(i, 2) = FirstPartH > Cells(i, 3) = SecontPartH > End If > End If > Next > End Sub > '_ > 'Basole. > > > Em segunda-feira, 16 de dezembro de 2013 23h09min31s UTC-2, Bill Q > escreveu: >> >> Hi, >> >> The macro below currently finds and removes selected characters that it >> find. It works great. No issues. >> >> What I would like is this to be modified so that if it finds a character >> within the array - it will move the character in question to the adjacent >> cell to the right, THEN it will clear the character it just found. >> >> Thanks. >> >> >> Sub CLEARNUMBERS001() >> s = Array("+", "-", ".5", "-.5", "0", "1", "2", "3", "4", "5", "6", "7", >> "8", "9") >> For Each r In Selection >> v = r.Value >> For i = 0 To 13 >> v = Replace(v, s(i), " ") >> Next >> r.Value = v >> Next >> End Sub >> > -- Are you =EXP(E:RT) or =NOT(EXP(E:RT)) in Excel? And do you wanna be? It’s =TIME(2,DO:IT,N:OW) ! Join official Facebook page of this forum @ https://www.facebook.com/discussexcel FORUM RULES 1) Use concise, accurate thread titles. Poor thread titles, like Please Help, Urgent, Need Help, Formula Problem, Code Problem, and Need Advice will not get quick attention or may not be answered. 2) Don't post a question in the thread of another member. 3) Don't post questions regarding breaking or bypassing any security measure. 4) Acknowledge the responses you receive, good or bad. 5) Jobs posting is not allowed. 6) Sharing copyrighted material and their links is not allowed. NOTE : Don't ever post confidential data in a workbook. Forum owners and members are not responsible for any loss. --- You received this message because you are subscribed to the Google Groups "MS EXCEL AND VBA MACROS" group. To unsubscribe from this group and stop receiving emails from it, send an email to excel-macros+unsubscr...@googlegroups.com. To post to this group, send email to excel-macros@googlegroups.com. Visit this group at http://groups.google.com/group/excel-macros. For more options, visit https://groups.google.com/groups/opt_out.