Rif
Nov 15th, 1999, 09:21 PM
I am having the following problem in VB and would be grateful for any help!
In a table (5 columns, 10 rows), in the first column, it says
"CAT"
"CAT"
"CAT"
"DOG"
"DOG"
"FISH"
"FISH"
What I want to do is check when it changes from CAT to DOG because I want to split the table each time the animal changes. How do I check when the word is no longer CAT but has changed to DOG?
At the moment I've got the following code:
Dim strRowInfo As String
Selection.EndKey Unit:=wdLine, Extend:=wdExtend
Selection.Tables(1).Cell(1, 1).Select
Selection.MoveDown Unit:=wdLine, Count:=1
strRowInfo = Selection.Text
If strRowInfo = "CAT" Then
Selection.MoveDown Unit:=wdLine, Count:=1
Else
Select Case strRowInfo
Case "DOG"
Selection.SplitTable
End Select
End If
End Sub
In a table (5 columns, 10 rows), in the first column, it says
"CAT"
"CAT"
"CAT"
"DOG"
"DOG"
"FISH"
"FISH"
What I want to do is check when it changes from CAT to DOG because I want to split the table each time the animal changes. How do I check when the word is no longer CAT but has changed to DOG?
At the moment I've got the following code:
Dim strRowInfo As String
Selection.EndKey Unit:=wdLine, Extend:=wdExtend
Selection.Tables(1).Cell(1, 1).Select
Selection.MoveDown Unit:=wdLine, Count:=1
strRowInfo = Selection.Text
If strRowInfo = "CAT" Then
Selection.MoveDown Unit:=wdLine, Count:=1
Else
Select Case strRowInfo
Case "DOG"
Selection.SplitTable
End Select
End If
End Sub