Hi,
I've been looking all over the forums and can't see any questions relating to my query - apologies if this has been answered elsewhere.
I have a project tracking sheet that has a series of grouped columns tracking the status of each project.
The sheet has standard actions and owners for each project (detailed in column B - D) From column E onward is the grouped project references:
Below is a vba i've found online, but in place of referencing cell E, is there a way to reference 2 columns back from last column? And it's not a must have, but if the checkboxes could also be centred in their cells, that would be great too.
Sub Addcheckboxes()
Dim cell, LRow As Single
Dim chkbx As CheckBox
Dim MyLeft, MyTop, MyHeight, MyWidth As Double
Application.ScreenUpdating = False
LRow = ActiveSheet.Range("A" & Rows.Count).End(xlUp).Row
For cell = 6 To LRow
If Cells(cell, "A").Value <> "" Then
MyLeft = Cells(cell, "E").Left
MyTop = Cells(cell, "E").Top
MyHeight = Cells(cell, "E").Height
MyWidth = Cells(cell, "E").Width
ActiveSheet.CheckBoxes.Add(MyLeft, MyTop, MyWidth, MyHeight).Select
With Selection
.Caption = ""
.Value = xlOff
.Display3DShading = False
End With
End If
Next cell
Application.ScreenUpdating = True
End Sub
I've been looking all over the forums and can't see any questions relating to my query - apologies if this has been answered elsewhere.
I have a project tracking sheet that has a series of grouped columns tracking the status of each project.
The sheet has standard actions and owners for each project (detailed in column B - D) From column E onward is the grouped project references:
column 1 - checkboxes (each referenced into the cells they're located in with a VBA) to format the colours in column 2
column 2 - due date
column 3 - dividing column to separate the projects
layout currently is (project 1 = e-f / project 2 = g-i / etc)
I want to the ability to add new projects to the tracker as required (using a form button) which is where i'm struggling with the checkboxes. I have a blank template on sheet 2 but while I can copy and paste the columns (it finds the last column no problem, formatting and column sizes work fine) I can't get the checkboxes to appear. I'm now trying to find a way to insert checkboxes into column 1 but as there is no fixed cell destination (i don't want to limit the number of projects this can track) i can't get the examples I've found online to work.Below is a vba i've found online, but in place of referencing cell E, is there a way to reference 2 columns back from last column? And it's not a must have, but if the checkboxes could also be centred in their cells, that would be great too.
Sub Addcheckboxes()
Dim cell, LRow As Single
Dim chkbx As CheckBox
Dim MyLeft, MyTop, MyHeight, MyWidth As Double
Application.ScreenUpdating = False
LRow = ActiveSheet.Range("A" & Rows.Count).End(xlUp).Row
For cell = 6 To LRow
If Cells(cell, "A").Value <> "" Then
MyLeft = Cells(cell, "E").Left
MyTop = Cells(cell, "E").Top
MyHeight = Cells(cell, "E").Height
MyWidth = Cells(cell, "E").Width
ActiveSheet.CheckBoxes.Add(MyLeft, MyTop, MyWidth, MyHeight).Select
With Selection
.Caption = ""
.Value = xlOff
.Display3DShading = False
End With
End If
Next cell
Application.ScreenUpdating = True
End Sub