Mackeral
Board Regular
- Joined
- Mar 7, 2015
- Messages
- 249
- Office Version
- 365
- Platform
- Windows
The Code
I want it to leave the selected range with the dotted line around it that means that it can be pasted later. This code does select it but does not leave as pasteable (with the dotted line around it).
This code does what I want:
Is the problem the "With SHEET"?
Thanks for your help, Mac
Code:
Sub Data_CutCopy_Sub(Sheet_Spec, Rng, Start_Row, Mode_ As CutCopy_Mode)
' Common code for Cut/Copy.
' 4/30/148 Created. WML
Prog = "Data_CutCopy_Sub"
Call Sheet_Arg(Sheet_Spec, SHEET, Sheet_Name)
Rng = [COLOR=#574123]Range("C1293:D1293") ' <-- To make explicit what "Rng" is.[/COLOR]
With SHEET
Select Case Mode_
Case ccm_Copy
Range(Rng).Select ' <-- This is the code that executes when I run this macro.
Selection.Copy
Case ccm_Cut
.Selection Cut
End Select
End With
End Sub ' Data_CutCopy
This code does what I want:
Code:
Range("C1293:D1293").Select
Selection.Copy
Thanks for your help, Mac