Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Newbie - Move Selection one cell to right

Hi,

I need to move the values in a selection one cell to the right. Th
selection is not limited one one row or column and I don't want to mov
the formatting. I tried this (which as pseudo-code does what I want
but it gives an error because the PasteSpecial method doesn't work wit
Cut:

Code
-------------------

Selection.Cut
Selection.Offset(0, 1).Select
Selection.PasteSpecial xlPasteValues

-------------------

Any ideas? Thanks in advance for your help!

-Dann

--
Message posted from http://www.ExcelForum.com

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 63
Default Newbie - Move Selection one cell to right

selection.offset(0,1).value = selection.value
perhaps?

--
Return email address is not as DEEP as it appears
"dpolkinhorn " wrote in message
...
Hi,

I need to move the values in a selection one cell to the right. The
selection is not limited one one row or column and I don't want to move
the formatting. I tried this (which as pseudo-code does what I want)
but it gives an error because the PasteSpecial method doesn't work with
Cut:

Code:
--------------------

Selection.Cut
Selection.Offset(0, 1).Select
Selection.PasteSpecial xlPasteValues

--------------------

Any ideas? Thanks in advance for your help!

-Danny


---
Message posted from http://www.ExcelForum.com/



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 63
Default Newbie - Move Selection one cell to right

Oops
and to that perhaps add the line
selection.clearcontents

--
Return email address is not as DEEP as it appears
"Jack Schitt" wrote in message
...
selection.offset(0,1).value = selection.value
perhaps?

--
Return email address is not as DEEP as it appears
"dpolkinhorn " wrote in
message ...
Hi,

I need to move the values in a selection one cell to the right. The
selection is not limited one one row or column and I don't want to move
the formatting. I tried this (which as pseudo-code does what I want)
but it gives an error because the PasteSpecial method doesn't work with
Cut:

Code:
--------------------

Selection.Cut
Selection.Offset(0, 1).Select
Selection.PasteSpecial xlPasteValues

--------------------

Any ideas? Thanks in advance for your help!

-Danny


---
Message posted from http://www.ExcelForum.com/





  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 63
Default Newbie - Move Selection one cell to right

Ok, as the selection can be more than one column wide:

Selection.Offset(0, 1).Value = Selection.Value
Selection.Resize(, 1).ClearContents

--
Return email address is not as DEEP as it appears
"dpolkinhorn " wrote in message
...
Jack,

Thanks for the reply. Actually that just seems to copy the cells.
Here's another example. If you select B1:C2 then run the macro,

Code:
--------------------

A B C D
1 5 4
2 3 9
--------------------

you would get this:

Code:
--------------------

A B C D
1 5 4
2 3 9
--------------------


Thanks again for your help!

-Danny


---
Message posted from http://www.ExcelForum.com/



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Newbie - Move Selection one cell to right

Jack,

That's exactly what I needed, thanks!

btw, I added the line:
Selection.Offset(0,1).Select
to also move the selection.

Thanks again for your help!
-Dann

--
Message posted from http://www.ExcelForum.com

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
Move selection camlad Excel Discussion (Misc queries) 3 December 6th 09 11:15 AM
How can I move to the first cell in the selection in Excel 07? Ruchir[_2_] Excel Worksheet Functions 7 October 31st 09 03:25 AM
Move Selection My3gals Excel Discussion (Misc queries) 4 February 5th 07 02:31 PM
Arrows move worksheet rather than cell selection, how fix? grenada49 Excel Worksheet Functions 3 May 17th 05 09:05 PM
Move selection down one cell GB[_3_] Excel Programming 3 October 12th 03 02:47 PM


All times are GMT +1. The time now is 03:26 AM.

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

About Us

"It's about Microsoft Excel"