Hi all
I already have a VBA code which allows me to have crosshatchings which helps to prevent me inputting errors.
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Target.Cells.Count > 1 Then Exit Sub
Application.ScreenUpdating = False
' Clear the color of all the cells
Cells.Interior.ColorIndex = 0
With Target
' Highlight the entire row and column that contain the active cell
.EntireRow.Interior.ColorIndex = 5
.EntireColumn.Interior.ColorIndex = 3
End With
Application.ScreenUpdating = True
End Sub
a) However I want to create 1 button to sit on the worksheet (not on the ribbon) that allows users to turn the hatching on and off as necessary ie. press for on/off
I have not created buttons before (all I know is that there are 2 methods in which they can be created 'Form Control' and 'ActiveX' > I dont understand the difference between them!)
As I am new at this bit please may I have stepbystep?
b) additionally can I modify my VBA code to suggest a range for the crosshatching rather than them being over the whole worksheet ie A7:AY39
cheers
RM
I already have a VBA code which allows me to have crosshatchings which helps to prevent me inputting errors.
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Target.Cells.Count > 1 Then Exit Sub
Application.ScreenUpdating = False
' Clear the color of all the cells
Cells.Interior.ColorIndex = 0
With Target
' Highlight the entire row and column that contain the active cell
.EntireRow.Interior.ColorIndex = 5
.EntireColumn.Interior.ColorIndex = 3
End With
Application.ScreenUpdating = True
End Sub
a) However I want to create 1 button to sit on the worksheet (not on the ribbon) that allows users to turn the hatching on and off as necessary ie. press for on/off
I have not created buttons before (all I know is that there are 2 methods in which they can be created 'Form Control' and 'ActiveX' > I dont understand the difference between them!)
As I am new at this bit please may I have stepbystep?
b) additionally can I modify my VBA code to suggest a range for the crosshatching rather than them being over the whole worksheet ie A7:AY39
cheers
RM