Hi all,
I have it set up on a sheet for a macro to start whenever a cell is clicked, but I'm trying to figure out how to narrow that down to only certain column cells being clicked.
You can see the current code below... and it just basically activates the AddToCell macro once any cell is clicked. The problem with this is, it errors on cells with text in them and no longer lets me edit the sheet without disabling the macros and so on. So, instead of it activating on all cells, I'd like to find a way to have it just work for columns E-I.
Any help would be appreciated.
Thanks much
![]()
Sub AddToCell() 'ActiveCell.Value places the value or formula into the active cell 'on the active worksheet. ' 'ActiveCell.Value returns the value in the active cell of the active 'window. ' 'InputBox calls up the Excel input box for you to type in the number 'to be added to the original value. Val takes the text string 'returned from the input box and turns it into a number. ActiveCell.Value = ActiveCell.Value + _ Val(InputBox("Enter Stat", Default:=1)) End Sub Private Sub Worksheet_SelectionChange(ByVal Target As Range) Sheet5.AddToCell End Sub
Bookmarks