#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1
Default validating

How do I prevent people from pasting any data into cells that have a drop
down list?
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1,069
Default validating


This is from the reply by Elkar to a similar previous question:

Add this code to your workbook (use Alt-F11 to open the VB Editor, then
double-click "ThisWorkbook", then copy/paste the below code)

Private Sub Workbook_Activate()
Application.CutCopyMode = None
End Sub

Private Sub Workbook_SheetSelectionChange(ByVal Sh As Object, ByVal Target
As Range)
Application.CutCopyMode = None
End Sub

NOTE: If the user disables macros when the workbook is opened, then this
won't work.

Hope this helps,

Hutch

"Philashley" wrote:

How do I prevent people from pasting any data into cells that have a drop
down list?

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1,069
Default validating

The code in my previous reply prevents all paste operations in the workbook.
We can modify the code to prevent pasting only to specific cells. If you just
wanted to keep the user from pasting to B10 on Sheet1, you could use:

Private Sub Workbook_Activate()
Application.CutCopyMode = None
End Sub

Private Sub Workbook_SheetSelectionChange(ByVal Sh As Object, ByVal Target
As Range)
If Sh.Name < "Sheet1" Then Exit Sub
If Intersect(Target, Range("B10")) Is Nothing Then Exit Sub
Application.CutCopyMode = None
End Sub

This could be expanded for multiple cells.

Hutch

"Tom Hutchins" wrote:


This is from the reply by Elkar to a similar previous question:

Add this code to your workbook (use Alt-F11 to open the VB Editor, then
double-click "ThisWorkbook", then copy/paste the below code)

Private Sub Workbook_Activate()
Application.CutCopyMode = None
End Sub

Private Sub Workbook_SheetSelectionChange(ByVal Sh As Object, ByVal Target
As Range)
Application.CutCopyMode = None
End Sub

NOTE: If the user disables macros when the workbook is opened, then this
won't work.

Hope this helps,

Hutch

"Philashley" wrote:

How do I prevent people from pasting any data into cells that have a drop
down list?

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
Validating Text Neil Excel Discussion (Misc queries) 2 February 6th 07 12:03 AM
Validating certain cell Kasey Excel Worksheet Functions 0 August 17th 06 03:45 PM
validating Ayesha Excel Worksheet Functions 2 April 26th 06 02:56 PM
Validating Sdbenn90 Excel Discussion (Misc queries) 0 March 27th 06 12:05 AM
Validating cells Kevin Excel Discussion (Misc queries) 1 February 2nd 06 06:04 PM


All times are GMT +1. The time now is 11:13 PM.

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

About Us

"It's about Microsoft Excel"