Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Macro to move selected cell contents to a specific column on same row

Hello,

I am trying to write a macro to move data from one cell to a specific
column on the same row.

I have a data table like this:

A B C D E F
1 EMPLID Name Recommended Reserve Hover Not_Competetive
2 8163249 Bloggs
3 8894890 Jones
4 8293943 Smith


The order of names is important, and the EMPID needs to stay in column
A while the name needs to be able to be moved between columns
C,D,E,etc when you press an appropriate toolbar button.

eg.

A B C D E F
1 EMPLID Name Recommended Reserve Hover Not_Competetive
2 8163249 Bloggs
3 8894890 Jones
4 8293943 Smith


I need the flexibility of later on saying, "now I want Smith to move
to the Reserve column". I thought I could use the offset function to
select column A + 3 and past the data in there but I couldnt work out
how to make the offset always reference column A

Thanks,

Ben
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Macro to move selected cell contents to a specific column on same row

Ben,

Why do you need to reference column A. For instance, this macro will move
column B to C

Sub MoveToC()
With ActiveCell
.Cut Destination:=.Offset(0, 1)
End With
End Sub


This will move it to D

Sub MoveToD()
With ActiveCell
.Cut Destination:=.Offset(0, 2)
End With
End Sub

etc.

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"Ben Johnson" wrote in message
om...
Hello,

I am trying to write a macro to move data from one cell to a specific
column on the same row.

I have a data table like this:

A B C D E F
1 EMPLID Name Recommended Reserve Hover Not_Competetive
2 8163249 Bloggs
3 8894890 Jones
4 8293943 Smith


The order of names is important, and the EMPID needs to stay in column
A while the name needs to be able to be moved between columns
C,D,E,etc when you press an appropriate toolbar button.

eg.

A B C D E F
1 EMPLID Name Recommended Reserve Hover Not_Competetive
2 8163249 Bloggs
3 8894890 Jones
4 8293943 Smith


I need the flexibility of later on saying, "now I want Smith to move
to the Reserve column". I thought I could use the offset function to
select column A + 3 and past the data in there but I couldnt work out
how to make the offset always reference column A

Thanks,

Ben



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 cell contents with macro Peridot Excel Discussion (Misc queries) 4 September 30th 09 03:35 PM
how to move contents in column up one cell pmt Excel Worksheet Functions 2 April 16th 09 03:47 PM
Macro to transfer contents of 'Selected' cell to alternate cell. Gryndar Excel Worksheet Functions 7 December 20th 08 09:58 PM
How do I record a macro to move down and over to specific column VMH Excel Discussion (Misc queries) 2 March 13th 06 05:09 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


All times are GMT +1. The time now is 01:33 PM.

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"