PDA

View Full Version : Solved: Stop CommandButton moving or rename button



JeffT
02-13-2011, 10:33 AM
Hi

I have a spreadsheet which has 2 commandbuttons on (in a freezepane area at the top so they are always visible). Sometimes using code I add columns and rows, but the buttons then move down and to the right.

Is there anyway to fix the buttons one in Cell F1 & one in H1.

I have tried copy & paste to put them back where they were which is successful but the (Name) property changes, CommandButton1 becomes CommandButton3 & CommandButton2 becomes CommandButton1 so they no longer activate the code they are there for. I guess this is because #1 uses the next available number when it is pasted e.g. 3 & then as #1 no longer exists this is used by CB2 when it is pasted.

Hopefully this is quite simple. I've just thought, I could probably delete columns and rows before re adding them, so have another solution but I'd be interested in how to do this anyway.

Thanks

Jeff T

JeffT
02-13-2011, 12:05 PM
HiI changed the other code so the buttons don't move. Seemed easier.Jeff T