Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 04-13-2013, 11:13 AM
RoyLittle0 RoyLittle0 is offline Automatically add predefined block of cells Windows 7 64bit Automatically add predefined block of cells Office 2007
Novice
Automatically add predefined block of cells
 
Join Date: Apr 2013
Posts: 10
RoyLittle0 is on a distinguished road
Default Automatically add predefined block of cells

Hi,

I have created a basic form that will be used to fill out machine problems, The amount of information/Items i need will depend on how well the machine was built, a good machine may only have 3 issues where a bad machine could have over 20.

What i want is to be able to add additional blocks/group of cells as the previous ones fill up.

It will make more sense if you look at the attached document.

What i would also like is when a new block of cells are added it will increment on the Item Number.

Also, is there a way in to change the font colour if a tick box is selected.

Hope all this makes sense.
Attached Files
File Type: docx New PDI.docx (27.6 KB, 14 views)
Reply With Quote
  #2  
Old 04-14-2013, 12:13 AM
macropod's Avatar
macropod macropod is offline Automatically add predefined block of cells Windows 7 64bit Automatically add predefined block of cells Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,963
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

The simplest method of adding additional blocks/group of cells when the previous ones fill up is to create a custom quick part consisting of a complete block/group and insert that.

As for changing colours when a checkbox is checked, you can add the following code to your document's 'ThisDocument' code module:
Code:
Private Sub Document_ContentControlOnExit(ByVal ContentControl As ContentControl, Cancel As Boolean)
Dim Rng As Range
With ContentControl
  If .Type <> wdContentControlCheckBox Then Exit Sub
  With .Range
    If .Information(wdWithInTable) = False Then Exit Sub
    If .Rows(1).Cells.Count = .Cells(1).ColumnIndex Then Exit Sub
    If ContentControl.Checked = True Then
      .Rows(1).Cells(.Cells(1).ColumnIndex + 1).Range.Font.Color = wdColorRed
    Else
      .Rows(1).Cells(.Cells(1).ColumnIndex + 1).Range.Font.Color = wdColorAutomatic
    End If
  End With
End With
End Sub
For installation instructions, see: http://www.gmayor.com/installing_macro.htm
Note: You will need to re-save your document in the .docm format to retain the macro.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
Automatically add predefined block of cells How to make cells shift down automatically iffy Excel 7 04-15-2013 08:06 AM
Automatically add predefined block of cells Automatically add something to cells SavvyEd Excel 2 07-31-2012 08:54 PM
Automatically change the value of one cell so that two other cells become equal matthew544 Excel 5 09-18-2011 08:56 AM
How can I change the colors of cells automatically based on Job Completion? Learner7 Excel 0 07-06-2010 10:47 PM
format cells to automatically place quotes around text dirtleg Excel 1 09-16-2008 01:52 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 12:46 AM.


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