Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
No Name
 
Posts: n/a
Default move around cells

Hi Folks

All I want to do is:
select a cell
activate cell
Go to start of cell
Highlight first five characters
Cut these characters
Move left to adjacent cell
paste characters to cell
Move down
Move right

I'm quite happy to use a keyboard control to activate the
macro each time I need it.

I can do this in recorder but the cell ranges are hard
coded. I need it to be local to the cell I am in. All
help much appreciated.

Joe

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 20
Default move around cells

Joe,

try this:

Sub MoveAround()

Dim CellVal As String

CellVal = ActiveCell.Text
Range(ActiveCell.Address) = Right(CellVal, Len(CellVal) - 5)
ActiveCell.Offset(0, 1).Select
Range(ActiveCell.Address) = Left(CellVal, 5)

End Sub



wrote in message
...
Hi Folks

All I want to do is:
select a cell
activate cell
Go to start of cell
Highlight first five characters
Cut these characters
Move left to adjacent cell
paste characters to cell
Move down
Move right

I'm quite happy to use a keyboard control to activate the
macro each time I need it.

I can do this in recorder but the cell ranges are hard
coded. I need it to be local to the cell I am in. All
help much appreciated.

Joe



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 20
Default move around cells

Joe,

forgot the "Move down - Move right" part:

ActiveCell.Offset(1, 1).Select



"Fred" wrote in message
...
Joe,

try this:

Sub MoveAround()

Dim CellVal As String

CellVal = ActiveCell.Text
Range(ActiveCell.Address) = Right(CellVal, Len(CellVal) - 5)
ActiveCell.Offset(0, 1).Select
Range(ActiveCell.Address) = Left(CellVal, 5)

End Sub



wrote in message
...
Hi Folks

All I want to do is:
select a cell
activate cell
Go to start of cell
Highlight first five characters
Cut these characters
Move left to adjacent cell
paste characters to cell
Move down
Move right

I'm quite happy to use a keyboard control to activate the
macro each time I need it.

I can do this in recorder but the cell ranges are hard
coded. I need it to be local to the cell I am in. All
help much appreciated.

Joe





  #4   Report Post  
Posted to microsoft.public.excel.programming
No Name
 
Posts: n/a
Default move around cells

Hi Fred

You're a champ. Thanks for the help.
-----Original Message-----
Joe,

forgot the "Move down - Move right" part:

ActiveCell.Offset(1, 1).Select



"Fred" wrote in message
...
Joe,

try this:

Sub MoveAround()

Dim CellVal As String

CellVal = ActiveCell.Text
Range(ActiveCell.Address) = Right(CellVal, Len

(CellVal) - 5)
ActiveCell.Offset(0, 1).Select
Range(ActiveCell.Address) = Left(CellVal, 5)

End Sub



wrote in message
...
Hi Folks

All I want to do is:
select a cell
activate cell
Go to start of cell
Highlight first five characters
Cut these characters
Move left to adjacent cell
paste characters to cell
Move down
Move right

I'm quite happy to use a keyboard control to activate

the
macro each time I need it.

I can do this in recorder but the cell ranges are hard
coded. I need it to be local to the cell I am in.

All
help much appreciated.

Joe





.

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 cells down GARY Excel Discussion (Misc queries) 4 June 10th 11 02:59 PM
Can references (to cells being sorted) move with the cells? Zack Setting up and Configuration of Excel 1 January 16th 08 01:50 PM
Move cells according to value saman110 via OfficeKB.com Excel Discussion (Misc queries) 3 November 2nd 07 12:15 AM
Sorting cells: a list behind the cells do not move with the cell Ross M Excel Discussion (Misc queries) 2 September 21st 06 12:14 PM
Move cells Tom Ogilvy Excel Programming 1 August 28th 03 12:40 AM


All times are GMT +1. The time now is 10:54 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"