View Single Post
 
Old 04-26-2011, 01:01 AM
kilosub kilosub is offline Windows XP Office 2003
Novice
 
Join Date: Apr 2011
Posts: 24
kilosub is on a distinguished road
Default Need help on macro for looping

Hi All,

I'm new into macro thing. Currently given a task to convert over 50000 data from notepad to be copy to word and run a given macro. Appearently there still need of human intervention which I believe can be improve on the macro end.. Attach below is the macro provided to me. I'll humbly delighted if the macro can be shorten from its original.

thanks in advance.

Cheers!!
Kilosub

Sub Macro1()
'
' Macro1 Macro
'
Selection.EndKey Unit:=wdLine, Extend:=wdExtend
Selection.Delete Unit:=wdCharacter, Count:=1
Selection.TypeParagraph
Selection.TypeParagraph
Selection.TypeParagraph
Selection.TypeParagraph
Selection.TypeParagraph
Selection.TypeParagraph
Selection.MoveDown Unit:=wdLine, Count:=1
Selection.TypeParagraph
Selection.TypeParagraph
Selection.MoveDown Unit:=wdLine, Count:=5
Selection.TypeParagraph
Selection.TypeParagraph
Selection.MoveDown Unit:=wdLine, Count:=4
Selection.TypeParagraph
Selection.EndKey Unit:=wdLine, Extend:=wdExtend
Selection.Font.Bold = wdToggle
Selection.HomeKey Unit:=wdLine
Selection.MoveDown Unit:=wdLine, Count:=1
Selection.TypeParagraph
ActiveWindow.ActivePane.SmallScroll Down:=14
Selection.MoveDown Unit:=wdLine, Count:=1
Selection.TypeParagraph
Selection.MoveDown Unit:=wdLine, Count:=2
Selection.TypeParagraph
Selection.MoveDown Unit:=wdLine, Count:=5
Selection.TypeParagraph
Selection.MoveRight Unit:=wdCharacter, Count:=18
Selection.EndKey Unit:=wdLine
Selection.MoveLeft Unit:=wdCharacter, Count:=13, Extend:=wdExtend
Selection.Font.Bold = wdToggle
Selection.HomeKey Unit:=wdLine
Selection.MoveDown Unit:=wdLine, Count:=1
Selection.TypeParagraph
Selection.MoveDown Unit:=wdLine, Count:=5
Selection.TypeParagraph
Selection.MoveDown Unit:=wdLine, Count:=1
Selection.TypeParagraph
Selection.MoveDown Unit:=wdLine, Count:=4
Selection.TypeParagraph
Selection.MoveDown Unit:=wdLine, Count:=1
Selection.TypeParagraph
Selection.MoveDown Unit:=wdLine, Count:=1
Selection.TypeParagraph
Selection.Font.Size = 7
Selection.MoveUp Unit:=wdLine, Count:=1
Selection.Font.Size = 7
Selection.MoveDown Unit:=wdLine, Count:=1
Selection.TypeParagraph
Selection.MoveUp Unit:=wdLine, Count:=1
Selection.Font.Size = 7
Selection.MoveDown Unit:=wdLine, Count:=2
Selection.TypeParagraph
Selection.TypeParagraph
ActiveWindow.ActivePane.SmallScroll Down:=5
Selection.MoveDown Unit:=wdLine, Count:=1
Selection.TypeParagraph
Selection.MoveDown Unit:=wdLine, Count:=1
Selection.TypeParagraph
Selection.MoveDown Unit:=wdLine, Count:=1
Selection.TypeParagraph
Selection.MoveDown Unit:=wdLine, Count:=1
Selection.TypeParagraph
Selection.MoveDown Unit:=wdLine, Count:=1
End Sub
Reply With Quote