Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Move selection | Excel Discussion (Misc queries) | |||
How can I move to the first cell in the selection in Excel 07? | Excel Worksheet Functions | |||
Move Selection | Excel Discussion (Misc queries) | |||
Arrows move worksheet rather than cell selection, how fix? | Excel Worksheet Functions | |||
Move selection down one cell | Excel Programming |