Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1
Default Move cell contents with macro

I need to create a macro that will take the contents of a cell and move them
one column over and one cell up. The macro I made keeps putting any new move
in the same cell. It should take the contents of D3 and put them in C2, then
put the contents of D5 and put them in C4. My macro puts everything in C2, no
matter where I start. I'd appreciate anyhelp. Thanks!
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 703
Default Move cell contents with macro

As always, post your macro for comments.

Maybe something like:

ActiveCell.Offset(-1,-1)=ActiveCell.Value

Regards.
Per


On 30 Sep., 16:06, Peridot wrote:
I need to create a macro that will take the contents of a cell and move them
one column over and one cell up. The macro I made keeps putting any new move
in the same cell. It should take the contents of D3 and put them in C2, then
put the contents of D5 and put them in C4. My macro puts everything in C2, no
matter where I start. I'd appreciate anyhelp. Thanks!


  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2,722
Default Move cell contents with macro

You can create a relative reference using Offset

ActiveCell.Offset(-1,1).Value = ActiveCell.Value
ActiveCell.ClearContents
--
Best Regards,

Luke M
*Remember to click "yes" if this post helped you!*


"Peridot" wrote:

I need to create a macro that will take the contents of a cell and move them
one column over and one cell up. The macro I made keeps putting any new move
in the same cell. It should take the contents of D3 and put them in C2, then
put the contents of D5 and put them in C4. My macro puts everything in C2, no
matter where I start. I'd appreciate anyhelp. Thanks!

  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 5,939
Default Move cell contents with macro

try this... Note that it will not be happy if your active cell is in Column A
or on row 1 as it will be trying to acess cells that don't exist.

sub MoveStuff()
Activecell.offset(-1, -1).value = activecell.value
end sub
--
HTH...

Jim Thomlinson


"Peridot" wrote:

I need to create a macro that will take the contents of a cell and move them
one column over and one cell up. The macro I made keeps putting any new move
in the same cell. It should take the contents of D3 and put them in C2, then
put the contents of D5 and put them in C4. My macro puts everything in C2, no
matter where I start. I'd appreciate anyhelp. Thanks!

  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2,722
Default Move cell contents with macro

Oops, forgot the 2nd negative symbol

ActiveCell.Offset(-1,-1).Value = ActiveCell.Value
ActiveCell.ClearContents

--
Best Regards,

Luke M
*Remember to click "yes" if this post helped you!*


"Luke M" wrote:

You can create a relative reference using Offset

ActiveCell.Offset(-1,1).Value = ActiveCell.Value
ActiveCell.ClearContents
--
Best Regards,

Luke M
*Remember to click "yes" if this post helped you!*


"Peridot" wrote:

I need to create a macro that will take the contents of a cell and move them
one column over and one cell up. The macro I made keeps putting any new move
in the same cell. It should take the contents of D3 and put them in C2, then
put the contents of D5 and put them in C4. My macro puts everything in C2, no
matter where I start. I'd appreciate anyhelp. Thanks!

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How can I programatically move cell contents Steve9491 Excel Discussion (Misc queries) 3 February 2nd 09 10:01 AM
macro to move part of cell contents to another cell icetoad hisself Excel Discussion (Misc queries) 4 November 27th 06 07:19 PM
move cell contents David L Excel Discussion (Misc queries) 13 November 24th 05 08:18 PM
Macro to remove contents of cell and move all other contents up one row adw223 Excel Discussion (Misc queries) 1 July 1st 05 03:57 PM
How to move cell contents Stephane Excel Discussion (Misc queries) 6 January 13th 05 12:49 AM


All times are GMT +1. The time now is 06:25 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"