-
Nov 12th, 2013, 08:56 PM
#1
Thread Starter
Junior Member
Cut, Paste and Insert by Range Name
I am on a Mac using Office 2011. I have encountered several different versions of VBA that have very different syntax for these same functions.
I simply want to give a cell range, a name, then instruct the macro to copy, cut and/or insert past those cells based upon those cell range names.
This seems to be working for "Naming" the cell at least there are no compile or run-time error messages.
Sheet1.Names.Add Name:="SDate", RefersTo:="BA6:BA2000", Visible:=True
Sheet1.Names.Add Name:="SOpen", RefersTo:="BB6:BB2000", Visible:=True
Sheet1.Names.Add Name:="SHigh", RefersTo:="BC6:BC2000", Visible:=True
Sheet1.Names.Add Name:="SLow", RefersTo:="BD6:BD2000", Visible:=True
Sheet1.Names.Add Name:="SClose", RefersTo:="BE6:BE2000", Visible:=True
Sheet1.Names.Add Name:="SVolume", RefersTo:="BF6:BF2000", Visible:=True
Sheet1.Names.Add Name:="SAdjClose", RefersTo:="BG6:BG2000", Visible:=True
What is not working is when I attempt the following:
Range("SAdjClose").Select
Selection.Cut
Range("SClose").Select
Selection.Paste
Range("SVolume").Select
Selection.Cut
Range("SOpen").Select
Selection.Insert Shift:=xlToRight
Can someone point out the correct syntax or formats for these actions?
Thanks, Michael
Last edited by MSlattery; Nov 12th, 2013 at 08:59 PM.
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|