D
Doug Salicblue
Hi,
I've got two separate macros.
The first one is in Word:
Sub FindH()
Set d = ActiveDocument
Set r = d.Range
Set x = GetObject(, "Excel.Application")
r.Find.Highlight = True
r.Find.Forward = True
Do While r.Find.Execute
If r.HighlightColorIndex = wdYellow Then
With x.ActiveCell.Range("A2")
.Value = r
.Activate
End With
End If
intposition = r.End
r.Start = intposition
Loop
End Sub
And the second is in Excel:
Sub Break column
Range("A:B").NumberFormat = "@"
Range("A:A").TextToColumns Destination:=Range("A1"),
DataType:=xlFixedWidth, _
FieldInfo:=Array(Array(0, 1), Array(7, 1))
End Sub
I want to be able to use the two together on the one macro.
I tried copying in "Range("A:A").TextToColumns..." and placing an "x." in
front of it, but it doesn't work.
"x.Range("A1").Select" works though... So the problem is with texttocolumns
method...
Can anyone help me with this?
Thanks so much in advance!
I've got two separate macros.
The first one is in Word:
Sub FindH()
Set d = ActiveDocument
Set r = d.Range
Set x = GetObject(, "Excel.Application")
r.Find.Highlight = True
r.Find.Forward = True
Do While r.Find.Execute
If r.HighlightColorIndex = wdYellow Then
With x.ActiveCell.Range("A2")
.Value = r
.Activate
End With
End If
intposition = r.End
r.Start = intposition
Loop
End Sub
And the second is in Excel:
Sub Break column
Range("A:B").NumberFormat = "@"
Range("A:A").TextToColumns Destination:=Range("A1"),
DataType:=xlFixedWidth, _
FieldInfo:=Array(Array(0, 1), Array(7, 1))
End Sub
I want to be able to use the two together on the one macro.
I tried copying in "Range("A:A").TextToColumns..." and placing an "x." in
front of it, but it doesn't work.
"x.Range("A1").Select" works though... So the problem is with texttocolumns
method...
Can anyone help me with this?
Thanks so much in advance!