View Single Post
 
Old 01-06-2024, 02:56 AM
gmaxey gmaxey is offline Windows 10 Office 2019
Expert
 
Join Date: May 2010
Location: Brasstown, NC
Posts: 1,617
gmaxey is just really nicegmaxey is just really nicegmaxey is just really nicegmaxey is just really nicegmaxey is just really nice
Default

The answer to your basic question is no. However, you can add a plain text content control to your cells and use something like the following in the VB Project ThisDocument module:


Code:
Option Explicit
Dim oCCTarget As ContentControl
Private Sub Document_ContentControlOnEnter(ByVal ContentControl As ContentControl)
  Set oCCTarget = ContentControl
End Sub
Private Sub Document_ContentControlOnExit(ByVal ContentControl As ContentControl, Cancel As Boolean)
  Set oCCTarget = Nothing
End Sub
Sub Increment()
  If Not oCCTarget Is Nothing Then
   Select Case oCCTarget.Range.Text
     Case Is = vbNullString
       oCCTarget.Range.Text = 1
     Case Else
       If IsNumeric(oCCTarget.Range.Text) Then
         oCCTarget.Range.Text = Val(oCCTarget.Range.Text) + 1
       Else
         oCCTarget.Range.Text = 1
       End If
  End Select
 End If
lbl_Exit:
  Exit Sub
End Sub
__________________
Greg Maxey
Please visit my web site at http://www.gregmaxey.com/
Reply With Quote