Bill, try this code in the "B" column, passes the data from column "A" 
without the character, and insert the "+" character.


'first of all, it is advisable to make a back-up of data.
Sub InsertChr()
Dim orig, rev, RevL, RevR, ss, result
Dim Lastrow1, Lastrow2 As Integer
Dim i As Long
Lastrow1 = Cells.Find("*", [B1], , , xlByRows, xlPrevious).Row
Worksheets(1).Range("B1:B" & Lastrow1).ClearContents
Lastrow2 = Cells.Find("*", [A1], , , xlByRows, xlPrevious).Row
i = 1
For i = i To Lastrow2
If InStr(Cells(i, 1), "+") > 0 Or InStr(Cells(i, 1), "-") > 0 Then
Cells(i, 2).Value = Cells(i, 1).Value
Else
orig = Cells(i, 1)
rev = StrReverse(orig)
RevL = Left(rev, InStr(rev, " "))
RevR = Right(rev, Len(rev) - InStr(rev, " "))
ss = Replace(rev, RevL & RevR, RevL & "+ " & RevR)
result = StrReverse(ss)
End If
If Cells(i, 2) <> "" Then
Else
Cells(i, 2) = result
End If
Next
End Sub

'then run this code you need to result in columns "C" and "D" respectively.

  'code is the same, only changed columns
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, 2), "+") > 0 Then
FirstPartM = Left(Cells(i, 2), InStr(Cells(i, 2), "+") - 1) 'start b1
SecontPartM = Right(Cells(i, 2), Len(Cells(i, 2)) - InStr(Cells(i, 2), "+") 
+ 1)
Cells(i, 3) = FirstPartM  'start c1
Cells(i, 4) = SecontPartM  'start d1
Else
If InStr(Cells(i, 2), "-") > 0 Then
FirstPartH = Left(Cells(i, 2), InStr(Cells(i, 2), "-") - 1) 'start b1
SecontPartH = Right(Cells(i, 2), Len(Cells(i, 2)) - InStr(Cells(i, 2), "-") 
+ 1)
Cells(i, 3) = FirstPartH  'start c1
Cells(i, 4) = SecontPartH 'start d1
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.

Reply via email to