Try this One:
Sub MyTest() Dim wksSheet As Worksheet Set wksSheet = ThisWorkbook.Worksheets("Sheet1") Application.screenUpdating=False With wksSheet .Range("D2").Formula = "=LEFT(A2,FIND(""U"",A2,1))" .Range("E2").Formula = "=RIGHT(A2,LEN(A2)-LEN(D2))" .Range("F2").Formula = "=b2" .Range("G2").Formula = "=LEFT(C2,3)" .Range("h2").Formula = "=MID(C2,5,4)" .Range("i2").Formula = "=MID(C2,10,2)" .Range("i2").Formula = "=MID(C2,13,2)" .Range("D2:I" & .UsedRange.Rows.Count).FillDown .Range("D2:I" & .UsedRange.Rows.Count).Value = .Range("D2:I" & .UsedRange.Rows.Count).Value End With Application.screenUpdating=True End Sub From: excel-macros@googlegroups.com [mailto:excel-macros@googlegroups.com] On Behalf Of dguillett1 Sent: Jan/Thu/2012 06:24 To: excel-macros@googlegroups.com Subject: Re: $$Excel-Macros$$ Macro for inserting columns and fill with strings Using TTC See attached Sub ParseColumnsSAS() Application.ScreenUpdating = False Columns("d:j").Delete Application.DisplayAlerts = False Columns("A").TextToColumns Destination:=Range("D1"), DataType:=xlFixedWidth, _ OtherChar:="", FieldInfo:=Array(Array(0, 1), Array(4, 1)), TrailingMinusNumbers:=True Columns("B").Copy Columns("F") Columns("c").TextToColumns Destination:=Range("G1"), DataType:=xlDelimited, _ TextQualifier:=xlDoubleQuote, ConsecutiveDelimiter:=False, Tab:=False, _ Semicolon:=False, Comma:=False, Space:=False, Other:=True, OtherChar:="-" Application.DisplayAlerts = True With Columns("d:j") .AutoFit .Interior.ColorIndex = 35 End With Application.ScreenUpdating = True End Sub Don Guillett SalesAid Software dguille...@gmail.com From: Darwin Chan <mailto:darwin.chankaw...@gmail.com> Sent: Tuesday, January 17, 2012 11:31 PM To: excel-macros@googlegroups.com Subject: $$Excel-Macros$$ Macro for inserting columns and fill with strings Dear group, I want to insert several columns and then split the information. The no. of entries is different everyday. -- Darwin Chan darwin.chankaw...@gmail.com kw42c...@yahoo.com.hk -- FORUM RULES (986+ members already BANNED for violation) 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) Cross-promotion of, or links to, forums competitive to this forum in signatures are prohibited. NOTE : Don't ever post personal or confidential data in a workbook. Forum owners and members are not responsible for any loss. ---------------------------------------------------------------------------- -------------------------- To post to this group, send email to excel-macros@googlegroups.com -- FORUM RULES (986+ members already BANNED for violation) 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) Cross-promotion of, or links to, forums competitive to this forum in signatures are prohibited. NOTE : Don't ever post personal or confidential data in a workbook. Forum owners and members are not responsible for any loss. ---------------------------------------------------------------------------- -------------------------- To post to this group, send email to excel-macros@googlegroups.com -- FORUM RULES (986+ members already BANNED for violation) 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) Cross-promotion of, or links to, forums competitive to this forum in signatures are prohibited. NOTE : Don't ever post personal or confidential data in a workbook. Forum owners and members are not responsible for any loss. ------------------------------------------------------------------------------------------------------ To post to this group, send email to excel-macros@googlegroups.com