Home |
Search |
Today's Posts |
#1
![]() |
|||
|
|||
![]() Mobys of VBA, I 'm trying to write what I assumed was a simple copy & paste procedure using a checkbox value as the trigger. I have tried numerous variations, but to no avail. I get no error messages, I also get no desired results, except that everytime I run the code it does unprotect and protect the worksheet and it always clears the contents of rng2. The two named ranges (rng1 & rng2) are unprotected and the same size and configuration (i.e. A20:A22, A43:A45 respectively) , but they are on different sheets. Thanks for any help Here is my best code to date: Option Explicit Private Sub ChkboxRFP_Click() Dim i As Boolean Dim rng1 As Range Dim rng2 As Range Set rng1 = Sheets("Name Sheet").Range("RFPMsgSource") Set rng2 = ActiveSheet.Range("RFPMsgDestination") i = CheckBox1.Value ActiveSheet.Unprotect ("geekk") If i = True Then rng2.ClearContents 'Clear old text rng1.Copy rng2.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _ :=False, Transpose:=False ElseIf i = False Then rng2.ClearContents End If ActiveSheet.Protect ("geekk") End Sub -- Casey ------------------------------------------------------------------------ Casey's Profile: http://www.excelforum.com/member.php...fo&userid=4545 View this thread: http://www.excelforum.com/showthread...hreadid=475905 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Can't Copy and Paste or Paste Special between Excel Workbooks | Excel Discussion (Misc queries) | |||
copy and paste code problem | Excel Worksheet Functions | |||
Copy Paste Special Macro | Excel Discussion (Misc queries) | |||
Locating variable range to copy | New Users to Excel | |||
copy paste cell character limit | Excel Discussion (Misc queries) |