find p- and split before it to next cell

shrinivasmj

Board Regular
Joined
Aug 29, 2012
Messages
140
i need a vba code

its in cell b1 split to cell c2

find p- and split before it to next cell

CLI-65389 CLI-OvQ-Jmn_65389 P-805183301131393 RMLCEOSHGHMVKTNB Western Mutual Insurance Group B6ZT9YJ7 Protection Plans LI2542168 475 2 Year YVONNE M NELSON 460 W SCHULTE RD ATLANTA CA 90136 (773) 224-9209 3
 
this id data

AMI-77561 AMI-OvQ-Jmn_77561 P-751502213743641 IIJH7NQSP58AGIZB American International Group (AIG) 4A592HCA Liability Insurance C192373823 1000 1 Year JEFF CHUDY 601 E 11th St New York NY 10009-4167 (909) 549-0475 N.A. 4 Wheeler Medallion White AU7lBECHC630KN VXYKKLDUROOZZCE3G 5/19/2011 Credit Card 90 15 enRoute C-201471432106888 N.A. JEFF CHUDY 4jjhoex17a636swi
 
Upvote 0

Excel Facts

Can a formula spear through sheets?
Use =SUM(January:December!E7) to sum E7 on all of the sheets from January through December
Try this version then
Code:
Sub Split_Text_v2()
  With Range("B1", Range("B" & Rows.Count).End(xlUp))
    .Replace What:=" P-", Replacement:="|P-", LookAt:=xlPart
    .TextToColumns DataType:=xlDelimited, Tab:=False, Semicolon:=False, Comma:=False, Space:=False, Other:=True, OtherChar:="|"
  End With
End Sub
 
Upvote 0
i need the vb code were i can set + or - if i put the function were there text is 798797-ytutu and i will assign find - and -6
 
Upvote 0
i need the vb code were i can set + or - if i put the function were there text is 798797-ytutu and i will assign find - and -6
This appears to be a new question & I don't understand it. Sample data and expected results please.

Did the suggested code answer the original question?
 
Upvote 0

Forum statistics

Threads
1,223,909
Messages
6,175,315
Members
452,634
Latest member
cpostell

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top