how to fill all cells that are empty in a table with a hyphen?

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance

From: Gil Carter (emr.RemoveThisWord_at_surewest.net)
Date: 02/13/05


Date: Sun, 13 Feb 2005 13:49:38 -0800

Hi All,

How does one put a hyphen in all empty cells in a table?
tia
Gil

Some of my efforts are:
Sub a1()
'
' a1 macro
'
'
    Selection.MoveRight Unit:=wdCell

Dim MyVar, MyCheck
MyCheck = IsNull(MyVar) ' Returns False.

'MyVar = ""
'MyCheck = IsNull(MyVar) ' Returns False.'

'MyVar = Null
'MyCheck = IsNull(MyVar) ' Returns True.

MyVar = Selection.Text

    If MyCheck = IsNull(MyVar) = True Then
    Selection.TypeText Text:="-"
    ElseIf MyCheck = IsNull(MyVar) = False Then

' End If

' If MyVar = Null Then
' Selection.TypeText Text:="-"
' ElseIf MyCheck = False Then
' End If
End If
End Sub



Relevant Pages

  • RE: (Complex) Loop within loop to create worksheets - anyone?
    ... I'm having a heck of a time with this macro which I've had way ... names to propagate into worksheets. ... Sub userform_initialize ... lblLastTime.Caption = myVar ...
    (microsoft.public.excel.programming)
  • Naming Worksheets - Loop within a loop issue
    ... I'm having a heck of a time with this macro which I've had way ... names to propagate into worksheets. ... Sub userform_initialize ... lblLastTime.Caption = myVar ...
    (microsoft.public.excel.programming)
  • (Complex) Loop within loop to create worksheets
    ... I'm having a heck of a time with this macro which I've had way ... names to propagate into worksheets. ... Sub userform_initialize ... lblLastTime.Caption = myVar ...
    (microsoft.public.excel.programming)
  • Re: API/Konstante wird in mehreren Quelldateien gebraucht
    ... Dies kann später im Programm zu einer ausgedehnten Fehlersuche führen. ... Global MyVar As String ... Private Sub MySub() ... Dadurch wird jetzt aber die globale Variable gelöscht. ...
    (microsoft.public.de.vb)
  • Re: question about get and set property
    ... Private myVar ... Public Property Let myProperty ... Public Property Get myProperty() ... Sub setButton_OnClick ...
    (microsoft.public.scripting.vbscript)