Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Code for eliminating specific lines in Words Document
#2
Select the text and run the following macro. This macro gets selected text, eliminates lines without "Jupiter", and pastes back.

Code:
Copy      Help
[color=blue]str [/color]s.getsel ss
ARRAY([color=blue]str[/color]) a
[color=blue]if[/color]([color=blue]findrx[/color](s "(?m)^\(\w+\)[ \d\-:]+Jupiter.+$" 0 13 a)<0) [color=blue]ret[/color]
[color=blue]int [/color]i
[color=blue]for [/color]i 0 a.len
,ss.formata("%s[]" a[0 i])
ss.setsel


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)