Thread
:
Macro needed
View Single Post
#
2
Posted to microsoft.public.excel.programming
Ardus Petus
external usenet poster
Posts: 718
Macro needed
Try this (not fully tested)
HTH
--
AP
'----------------
Sub transpose()
Dim rcell As Range
Dim rPivot As Range
' Validate selection
If Selection.Columns.Count < 1 _
Or Selection.Areas.Count < 1 Then
MsgBox "Select one column only"
Exit Sub
End If
' Initialize pivot cell
Set rPivot = Selection.Cells(1)
' Transpose
For Each rcell In Selection
rPivot.Offset(0, rcell.Row - rPivot.Row) = rcell.Value
' Clear old value
If rcell.Row < rPivot.Row Then rcell.ClearContents
Next rcell
End Sub
'------------------------
"keithdixon" a
écrit dans le message de news:
...
I am wanting a macro to move cut cells from a column and paste to
rows:-
Currently i have 15 cells in a column, and am needing the 1st to stay
where it is, cell 2 to move to the right of cell 1, cell 3 to move 2 to
the right of cell 1, cell 4 to move 3 to the right of cell 1 etc
Any clues?
I have tried recording a macro but it always paste's upon my 1st row.
Thanks in advance
regards
keith dixon
--
keithdixon
------------------------------------------------------------------------
keithdixon's Profile:
http://www.excelforum.com/member.php...o&userid=34264
View this thread:
http://www.excelforum.com/showthread...hreadid=540214
Reply With Quote
Ardus Petus
View Public Profile
Find all posts by Ardus Petus