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 / New Users / May 2008

Tip: Looking for answers? Try searching our database.

Simple Keyboard Maneuver

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Rebecca - 19 May 2008 17:02 GMT
I tried to make a macro to do this, but I failed.

I need to do this: in the same row I want to copy the contents of one cell
and then copy the same contents into the next cell to the right, and then
delete the contents in the left cell.

I have tried various keystrokes, but it doesn't seem to work. Is there any
way this can be automated? Of course using a macro would be nice, but as I
said I couldn't get it to do even this simple task. Could someone please give
me some advice? Also, I am incapable of writing a macro from scratch.

To repeat: copy the contents of a cell, paste the contents in the next cell
(to the right), and delete the contents of the first / left cell.
Mike H - 19 May 2008 17:56 GMT
try this,

Sub sonic()
ActiveCell.Offset(, 1).Value = ActiveCell.Value
ActiveCell.ClearContents
End Sub

Mike

> I tried to make a macro to do this, but I failed.
>
[quoted text clipped - 9 lines]
> To repeat: copy the contents of a cell, paste the contents in the next cell
> (to the right), and delete the contents of the first / left cell.
Roger Govier - 19 May 2008 18:28 GMT
Hi Rebecca

Without using a macro.
Place your cursor in source cell>Control+X
Place your cursor in destination cell>Control+V

Signature

Regards
Roger Govier

> I tried to make a macro to do this, but I failed.
>
[quoted text clipped - 11 lines]
> cell
> (to the right), and delete the contents of the first / left cell.
Rebecca - 20 May 2008 00:05 GMT
Thanks, Roger, but slow as I am I know that keystrokes. I need a faster way
to do this (since it's a large spreadsheet). I'll try Mike's macro, then
designate a hotkey, and that would eliminate a few strokes.

> Hi Rebecca
>
[quoted text clipped - 17 lines]
> > cell
> > (to the right), and delete the contents of the first / left cell.
Roger Govier - 20 May 2008 10:21 GMT
Hi Rebecca

if you need to do it for all cells within a column, you could just Highlight
the column>Insert
This would have the same effect.

Signature

Regards
Roger Govier

> Thanks, Roger, but slow as I am I know that keystrokes. I need a faster
> way
[quoted text clipped - 27 lines]
>> > cell
>> > (to the right), and delete the contents of the first / left cell.
Robert McCurdy - 20 May 2008 13:10 GMT
Select the cells or column, Ctrl + Shift + plus key
Ok, to shift cells to right.

With code:
activecell.EntireColumn.Insert shift:=xltoright

or
activecell = activecell(1,2) : activecell.clearcontents

or
With Selection
 .Copy .Offset(0, 1)
 .ClearContents
End With

Without knowing why you wish to do this, we cant advise you on the damage you can do to the worksheets Names and Formulas if you think this OK.
Changing the whole row or column would be a lot safer.
Which is easy to do with Ctrl & minus key for the selection.

Regards
Robert McCurdy
>I tried to make a macro to do this, but I failed.
>
[quoted text clipped - 9 lines]
> To repeat: copy the contents of a cell, paste the contents in the next cell
> (to the right), and delete the contents of the first / left cell.
 
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.