how i inactive all cells in a active sheet using VBA

dearmoawiz

Board Regular
Joined
Aug 20, 2008
Messages
62
hi guys
hows you all. i have query i want to create an application in EXCEL VBA in which i want to inactive all cells and only one cell will be selected on active sheet all other cells will be inactive.
so is there any one who guide me in this matter
thanxx in advance
waiting for response.
 

Excel Facts

Format cells as time
Select range and press Ctrl+Shift+2 to format cells as time. (Shift 2 is the @ sign).
Code:
activesheet.Range("A1").Select
adjusting the range as required.
HTH
 
Upvote 0
this will select a cell but if user click on any other cell then that cell will also be selected but i want that only selected cell will be active during whole whole sheet. User will not be able to select any other cell.
did u got my point HTH?

wiz
 
Upvote 0
Right click the sheet tab, select View Code and paste in

Code:
Private Sub Worksheet_Activate()
Me.ScrollArea = "A1"
End Sub
 
Upvote 0
You can select the cell you want unlocked, choose Format-Cells from the menu, and on the Protection tab uncheck the Locked option. Then protect the worksheet using Tools-Protect sheet and make sure the Select Locked cells option is unchecked.

PS. 'HTH' stands for 'Hope That Helps' - it's not my name. :)
 
Upvote 0
it's probably not OP either... ;)
 
Upvote 0
Is anyone still available on this one? This is exactly what I want to do as well, but I have a date picker calendar in a cell with this code:
Rich (BB code):
Private Sub Calendar1_DbleClick()
    ActiveCell.NumberFormat = "dd/mm/yyyy" (this line is yellow highlighted)
    ActiveCell = Calendar1
    Calendar1.Visible = False
End Sub

and I get a Run-time error '1004'
Unable to set the NumberFormat property of the Range class
 
Upvote 0

Forum statistics

Threads
1,221,310
Messages
6,159,173
Members
451,543
Latest member
cesymcox

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top