View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.misc
DanP DanP is offline
external usenet poster
 
Posts: 9
Default Copying & Pasting with recorded macros

Sheeloo,

Thank you. It's almost what I need. It copied the last name "Solano" from
the first cell and pasted it into the next cell, but Solano was not removed
from the first cell. The first cell still shows "James A. Solano"
--
Dan P.


"Sheeloo" wrote:

Try this
Sub Macro15()
x = Split(ActiveCell)
ActiveCell.Offset(0, 1) = x(UBound(x))
ActiveCell.Offset(1, 0).Select
End Sub

Following line in your macro is assinging James A. as the value of the
current cell...
ActiveCell.FormulaR1C1 = "James A. "
which is then copied to the next cell.

"DanP" wrote:

I wish to create a macro where I can cut the last word from a cell and paste
into the cell next to it. Then move to the cell below the previous cell.
That way, I can repeat the macro.

I'm quite familiar with the relative macro button and have used it lots of
times for other macros that do not require copying/cutting and pasting. I
have pasted the macro below for you to look at. The macro was recorded. The
problem that I have is everytime I use the macro, it copies and pastes the
same information from the original cell to any new cell I use.
======================
Sub Macro15()
'
' Macro15 Macro
' Macro recorded 4/15/2009 by 629237
'
' Keyboard Shortcut: Ctrl+Shift+K
'
ActiveCell.Select
ActiveCell.FormulaR1C1 = "James A. "
ActiveCell.Offset(0, 1).Range("A1").Select
ActiveSheet.Paste
ActiveCell.Offset(1, -1).Range("A1").Select
End Sub
======================
The original words in the cell are James A. Solano. But the words in each
cell below are different.

If someone could help, I would really appreciate it. By the way, I'm using
Excel 2002.

Thank you
--
Dan P.