Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / Programming / February 2007

Tip: Looking for answers? Try searching our database.

Macro Help

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Janna - 16 Feb 2007 01:52 GMT
I'd like to be able to place my cursor in a cell and run a macro that selects
that cell, plus 2 additional cells to the right (in the same row) and move
all three cells up one row. (basically a  cut and paste).

Easily possible???
Greg Wilson - 16 Feb 2007 03:32 GMT
Below are two options. The first only transfers values (ignores formatting)
and clears the contents of the source range. The second option does a cut and
paste (includes formatting).

Option 1:-

Sub XXX()
With ActiveCell.Resize(1, 3)
   .Offset(-1).Value = .Value
   .ClearContents
End With
End Sub

Option 2:-

Sub YYY()
With ActiveCell
   .Resize(1, 3).Cut .Offset(-1)
End With
End Sub

Regards,
Greg
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.