Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Mass group box delete
 
Posts: n/a
Default whole rows, not cells

I want to protect a particular sheet so that the user can only select copy
and paste whole rows, not individual cells. Is this possible?
  #2   Report Post  
Dave Peterson
 
Posts: n/a
Default whole rows, not cells

Maybe you could give the user a macro that would get the range to be copied,
extend it to the whole row, get the row to paste, unprotect the worksheet, do
the copy|Paste and then reprotect the worksheet.

Something like:

Option Explicit
Sub testme()

Dim RngToCopy As Range
Dim CellToPaste As Range
Dim myPWD As String

myPWD = "hi"

Set RngToCopy = Nothing
On Error Resume Next
Set RngToCopy = Application.InputBox _
(Prompt:="Select a row to copy", Type:=8).Cells(1).EntireRow
On Error GoTo 0

If RngToCopy Is Nothing Then
Exit Sub
End If

Set CellToPaste = Nothing
On Error Resume Next
Set CellToPaste = Application.InputBox _
(Prompt:="Select a row to paste", Type:=8).Cells(1).EntireRow
On Error GoTo 0

If CellToPaste Is Nothing Then
Exit Sub
End If

With RngToCopy
.Parent.Unprotect Password:=myPWD
On Error Resume Next
.Copy _
Destination:=CellToPaste
If Err.Number < 0 Then
MsgBox "Copy|Paste failed"
Err.Clear
End If
.Parent.Protect Password:=myPWD
End With
End Sub


Mass group box delete wrote:

I want to protect a particular sheet so that the user can only select copy
and paste whole rows, not individual cells. Is this possible?


--

Dave Peterson
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
identically size merged cells for sorting rows julieanne12 Excel Discussion (Misc queries) 1 August 24th 05 11:26 AM
Selecting rows from cells sakk555 Excel Discussion (Misc queries) 4 June 5th 05 12:21 AM
I want to sort selected cells in Excel, not entire rows. Aeryn635 Excel Discussion (Misc queries) 1 June 1st 05 07:58 PM
I Need to divide all cells in rows 2 and 3 by 100 Brent E Excel Discussion (Misc queries) 3 December 23rd 04 11:27 PM
Adding Rows to Master Sheet Excel Newbie New Users to Excel 1 December 23rd 04 10:56 PM


All times are GMT +1. The time now is 10:32 AM.

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"