0

I am using the odd rows and columns as padding right now. I am making sure the user can't insert anything in it through use of modular arithmetic:

  • If they are in an odd row and press enter, they are shifted down one, and then they can type to edit
  • If they are in an even row and press enter, they are shifted down two rows, then they can type to edit (or they can just type immediately to edit)

Now is there any way, via VBA to restrict the users ability to select/edit odd rows and columns altogether?

EDIT: I don't expect all odd rows/columns to be uneditable from the get go. I just need a function which takes as input the row, and then makes it so the whole row can't be clicked. Likewise for columns. In this way, if the user decides to add a new row/column, I first add a row/column, make it uneditable, then I add the row/column for the user to edit

Community
  • 1
  • 1
puk
  • 16,318
  • 29
  • 119
  • 199
  • 1
    Write code that goes through the sheet and locks the Odd and unlocks the even. Then protect the sheet so that the locked are not able to be chosen. – Scott Craner Jul 27 '16 at 18:02
  • I am doing that right now, but for some reason even changing the color of an unlocked cell is causing an error – puk Jul 27 '16 at 18:04
  • To user jeeped, this is not a duplicate. They are two different questions. Please read them again – puk Jul 27 '16 at 18:50
  • You need to use the `@` then the user name to get his attention. like @puk – Scott Craner Jul 27 '16 at 18:51
  • @ScottCraner I thought @ only works when responding to people, I didn't know it could be used to get any user's attention. – puk Jul 27 '16 at 18:54
  • @Jeeped please explain how the two questions are duplicates. – puk Jul 27 '16 at 18:54

0 Answers0