Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 59
Default only select one cell

I need a macro that will prevent users from selecting more than one cell at a
time.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default only select one cell

On May 18, 3:41 pm, Kiba wrote:
I need a macro that will prevent users from selecting more than one cell at a
time.


Not shure how you would accomplish this with a macro.. you could try a
BFH and some creative words.. Unless your user is a 5yr old.. they
should be able to select only ONE cell.. maby a 15min Training session
or something would work..

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 59
Default only select one cell

Well, I prefur safe to sorry. I'm running a macro and its tends to spaz if
you try to delete multiple cells at one time. Since I'm having trouble
getting to fix it I thought it might be simpler to just remove that ability.

"BaggedTaco" wrote:

On May 18, 3:41 pm, Kiba wrote:
I need a macro that will prevent users from selecting more than one cell at a
time.


Not shure how you would accomplish this with a macro.. you could try a
BFH and some creative words.. Unless your user is a 5yr old.. they
should be able to select only ONE cell.. maby a 15min Training session
or something would work..


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default only select one cell

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
On Error goto ErrHandler
Application.EnableEvents = False
Target(1).Select
SaveValue = Target(1).Value
ErrHandler:
Application.EnableEvents = True
End Sub

--
Regards,
Tom Ogilvy


"Kiba" wrote:

Well, I prefur safe to sorry. I'm running a macro and its tends to spaz if
you try to delete multiple cells at one time. Since I'm having trouble
getting to fix it I thought it might be simpler to just remove that ability.

"BaggedTaco" wrote:

On May 18, 3:41 pm, Kiba wrote:
I need a macro that will prevent users from selecting more than one cell at a
time.


Not shure how you would accomplish this with a macro.. you could try a
BFH and some creative words.. Unless your user is a 5yr old.. they
should be able to select only ONE cell.. maby a 15min Training session
or something would work..


  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,939
Default only select one cell

A couple of things... This code needs to be placed in the sheet itself (right
click the tab and select View Code and paste the code in the code window.)
The posted code will always select the upper left hand cell. If you would
prefer the following code will select the active cell which I found my users
prefered (personal preference). ***Note that this only makes a difference if
you have users that select ranges of cells right to left instead of left to
right.

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
On Error GoTo ErrHandler
Application.EnableEvents = False
ActiveCell.Select
ErrHandler:
Application.EnableEvents = True
End Sub

Finally (and this is for Tom) what is the significance of your Variable
"SaveValue" which you don't use?

--
HTH...

Jim Thomlinson


"Tom Ogilvy" wrote:

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
On Error goto ErrHandler
Application.EnableEvents = False
Target(1).Select
SaveValue = Target(1).Value
ErrHandler:
Application.EnableEvents = True
End Sub

--
Regards,
Tom Ogilvy


"Kiba" wrote:

Well, I prefur safe to sorry. I'm running a macro and its tends to spaz if
you try to delete multiple cells at one time. Since I'm having trouble
getting to fix it I thought it might be simpler to just remove that ability.

"BaggedTaco" wrote:

On May 18, 3:41 pm, Kiba wrote:
I need a macro that will prevent users from selecting more than one cell at a
time.

Not shure how you would accomplish this with a macro.. you could try a
BFH and some creative words.. Unless your user is a 5yr old.. they
should be able to select only ONE cell.. maby a 15min Training session
or something would work..




  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default only select one cell

You have an alternative approach at your other thread.

Kiba wrote:

I need a macro that will prevent users from selecting more than one cell at a
time.


--

Dave Peterson
  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 50
Default only select one cell

Hi Kiba ! :)
You need to write an event procedure as follows.

Private Sub Selection change()

If Instr(1,selection.address,":") 0 then
Msgbox "Selection not valid !!
Endif

End sub

This procedure displays an error message if a range larger than 1
cell is selected.

I hope you are able to adapt it ( use the idea ) for your specific
need.

Good luck !
"Kiba" wrote:

I need a macro that will prevent users from selecting more than one cell at a
time.

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
VBA: Column Select then Data Select then return to cell A1 James C[_2_] Excel Discussion (Misc queries) 3 February 1st 10 11:35 AM
Using formulas to select cells (Ex: Select every nth cell in a col Lakeview Photographic Services Excel Discussion (Misc queries) 2 March 15th 07 02:17 PM
Run Macro from cell change THEN select adjacent cell mslabbe Excel Programming 4 December 24th 06 06:49 PM
How to point to (select) a cell to the left from a cell where I enter the = equal sign? Dmitry Excel Discussion (Misc queries) 4 June 30th 06 06:49 AM
Select cell, Copy it, Paste it, Return to Previous cell spydor Excel Discussion (Misc queries) 1 December 30th 05 01:29 PM


All times are GMT +1. The time now is 06:17 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"