Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #2  
Old 01-06-2024, 02:56 AM
gmaxey gmaxey is offline Insert increase number button Windows 10 Insert increase number button 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
 



Similar Threads
Thread Thread Starter Forum Replies Last Post
Insert increase number button how can you have the the number of a document sequentially increase - QR Bar code mattyA1977 Word 2 01-28-2020 05:50 AM
Insert increase number button Looking for a macro to increase a number by 1 in a Word document Olopocram Word VBA 15 03-07-2018 05:39 PM
Insert increase number button increase the size of the insert hyperlink dialog box mswmacroman Word 3 02-16-2017 01:44 AM
How to increase Spin Button by .1 decimal KangarooJack Word VBA 3 12-08-2015 05:50 AM
Insert increase number button Increase serial number for every print atomtm Word 1 06-15-2012 05:39 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 01:37 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft