Insert in First Empty Cell

B

Benz

Hi Im having trouble figuring out in word how to Insert "text" into the first
empty cell in Col A. Any help would be appreciated!

Ben Z.
 
H

Helmut Weber

Hi Ben,

Sub Macro7()
Dim oTbl As Table
Dim oCll As Cell
Set oTbl = ActiveDocument.Tables(1)
With oTbl
For Each oCll In .Columns(1).Cells
If Len(oCll.Range) = 2 Then
oCll.Range.Text = "was empty"
Exit For
End If
Next
End With
End Sub

--
Greetings from Bavaria, Germany

Helmut Weber, MVP WordVBA

Win XP, Office 2003
"red.sys" & Chr$(64) & "t-online.de"
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top