A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Word » Tables
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Insert in First Empty Cell



 
 
Thread Tools Display Modes
  #1  
Old October 19th, 2007, 09:43 PM posted to microsoft.public.word.tables
BenZ
external usenet poster
 
Posts: 11
Default Insert in First Empty Cell

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.
  #2  
Old October 20th, 2007, 12:19 AM posted to microsoft.public.word.tables
Helmut Weber
external usenet poster
 
Posts: 131
Default Insert in First Empty Cell

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"
  #3  
Old October 20th, 2007, 07:39 AM posted to microsoft.public.word.tables
BenZ
external usenet poster
 
Posts: 11
Default Insert in First Empty Cell

Thank you! It works great!

Ben Z.

"Helmut Weber" wrote:

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"

 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 03:59 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.