sangeeta25
Board Regular
- Joined
- Jun 15, 2015
- Messages
- 59
HI EVERYONE
I have the following code:
Sub TextBox3_Click()
Range("E3").EntireRow.Insert Shift:=xlDown
Range("E3") = Range("E4") + 1
End Sub
which is a macro so when a user clicks on this text box the macro is made to, insert an entire new row also whilst this occurs, as you can see in the code above, column E will automatically be updated with a new number which will be the next number above the number in the cell below.
So for instance I have row E5 which reads 543 then when I click my textbox to which the macro is assigned, a new row will be inserted and in the new E5 cell will read 544 and the old E5 cell will become E4.
That's just some background which I'm not sure is relevant to my query but I want to know how I can protect or lock or make the entire column E read only because I want my macro to still work but I just don't want anyone to be able to click into the cells and manually change the numbers in column E.
Is there a code I can add to my current macro above or do I need another code and what is this code?
Regards
S
I have the following code:
Sub TextBox3_Click()
Range("E3").EntireRow.Insert Shift:=xlDown
Range("E3") = Range("E4") + 1
End Sub
which is a macro so when a user clicks on this text box the macro is made to, insert an entire new row also whilst this occurs, as you can see in the code above, column E will automatically be updated with a new number which will be the next number above the number in the cell below.
So for instance I have row E5 which reads 543 then when I click my textbox to which the macro is assigned, a new row will be inserted and in the new E5 cell will read 544 and the old E5 cell will become E4.
That's just some background which I'm not sure is relevant to my query but I want to know how I can protect or lock or make the entire column E read only because I want my macro to still work but I just don't want anyone to be able to click into the cells and manually change the numbers in column E.
Is there a code I can add to my current macro above or do I need another code and what is this code?
Regards
S