Need VBA to split some special string with prefix or suffix or mid
dear experts
I have set of data where i want split (cut and paste) special characteristic in long string value of column AS:AS
i have exising sheet disbursement _cases i want move data from sheet Ledger_All to sheet disbursement _cases if where string meets prefix or suffix or mid of string. follow by {Redemption*,Resurrection*,Cancellation*,(Feg-G)*,Disfunction*} in column AS:AS
if data in sheet disbursement _cases, clear first and copy and paste special string data into sheet
find the attachment disbursement _cases is expected result
Re: Need VBA to split some special string with prefix or suffix or mid
Hi All. Another way:
PHP Code:
Sub Macro_8() Dim Rng As Range, ws As Worksheet Application.ScreenUpdating = False: Set ws = ActiveSheet With ws .Columns("A:B").Insert: .Range("A1:B1") = "<CR>": Set Rng = .Cells(1).CurrentRegion End With With Rng.Columns(1) .Formula = "= IsNumber(Search(""redemption"", AU1)) + IsNumber(Search(""resurrection"", AU1)) + IsNumber(Search(""cancellation"", AU1)) + IsNumber(Search(""(Feg-G)"", AU1)) + IsNumber(Search(""Disfunction"", AU1))" .Value = .Value: .Range("A1") = "<CR>": .Range("B2") = 0 End With Do While ws.Range("B2") < 2 With Worksheets.Add(, ActiveSheet) .Range("A1").RowHeight = ws.Cells(1).RowHeight Rng.AdvancedFilter 2, ws.Range("B1:B2"), .Range("A1"), False .Columns("A:B").Delete: .Columns("AS").AutoFit End With ws.Range("B2") = 1 + ws.Range("B2") Loop Application.DisplayAlerts = False: ws.Delete: Application.DisplayAlerts = True End Sub
You are always very welcome if you add reputation by clicking the * (bottom left) of each message that has helped you.
Bookmarks