Hi All,
I have a piece of code here and I need to adjust the range to take into account new amendments made to the spreadsheet.
I am adding a new column before the code range and a column after every 2 columns in the code range. I will add a screenshot of the spreadsheet and where the new columns will be.
What I need the code to do is to work in the same columns it does now as otherwise it shifts by one and disrupts the whole spreadsheet.
Here's the code:
Columns will be added here (in red) added columns in red.PNG![]()
Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean) If Target.Column > 5 And Target.Column Mod 2 = 0 And Target.Row > 6 And Target.Row < 208 Then Cancel = True Select Case Target.Value Case "P" Target.Interior.ColorIndex = xlNone Target.Resize(, 2).Value = "" Case Else Target.Font.Name = "Wingdings 2" Target.Font.Size = 36 Target.Interior.Color = vbGreen Target.Offset(, 1).Value = Date Target.Value = "P" End Select End If End Sub Private Sub Worksheet_SelectionChange(ByVal Target As Range) End Sub
Bookmarks