#1   Report Post  
Paweł Gałecki
 
Posts: n/a
Default Column vs Row

How can you make Excel to advance one row instead of one column?


For example you in A1 you have:
:=D1
One after draggin it one cell below (A2)i would like to have
:=E1
instead of
:=D2


any clue??
  #2   Report Post  
Jim Rech
 
Posts: n/a
Default

I don't believe copying the way you want is possible with built-in Excel
tools. I've had the same need as you though so I wrote this macro several
years ago and it has met my infrequent needs for what I call "transpose
copying". I don't even remember which situations it will work in and which
it will fail in, beyond simple ones like your example. So for what it's
worth...

This is the way you'd use it:
-In A1 enter =D1
-Select the range A1:A4
-Run macro.
-Formulas referencing E1, F1 and G1 should appear.

You can also select a horizontal range and get the fill going that way
referencing a vertical range.


''Fills a single cell across/down a selection transposing row/column
Sub FillTranspose()
Dim HoldBuffer As String, Counter As Long
Dim SrcCols As Long, SrcRows As Long
Dim KeyCell As Range, CalcMode As Long
Application.ScreenUpdating = False
CalcMode = Application.Calculation
Application.Calculation = xlManual
Set KeyCell = Selection.Cells(1)
SrcCols = Selection.Columns.Count
SrcRows = Selection.Rows.Count
If SrcRows = 1 And SrcCols 1 Then
For Counter = 2 To SrcCols
HoldBuffer = KeyCell.Offset(Counter - 1, 0).Formula
KeyCell.Copy
KeyCell.Offset(Counter - 1, 0).PasteSpecial xlFormulas
KeyCell.Offset(0, Counter - 1).Formula =
KeyCell.Offset(Counter - 1, 0).Formula
KeyCell.Offset(Counter - 1, 0).Formula = HoldBuffer
Next
ElseIf SrcCols = 1 And SrcRows 1 Then
For Counter = 2 To SrcRows
HoldBuffer = KeyCell.Offset(0, Counter - 1).Formula
KeyCell.Copy
KeyCell.Offset(0, Counter - 1).PasteSpecial xlFormulas
KeyCell.Offset(Counter - 1, 0).Formula = KeyCell.Offset(0,
Counter - 1).Formula
KeyCell.Offset(0, Counter - 1).Formula = HoldBuffer
Next
Else
MsgBox "Can only fill one row or one column"
End If
KeyCell.Select
Application.Calculation = CalcMode
End Sub


--
Jim Rech
Excel MVP
"Pawel Galecki" wrote in message
...
| How can you make Excel to advance one row instead of one column?
|
|
| For example you in A1 you have:
| :=D1
| One after draggin it one cell below (A2)i would like to have
| :=E1
| instead of
| :=D2
|
|
| any clue??


  #3   Report Post  
RagDyeR
 
Posts: n/a
Default

Enter this in A1, and drag down to copy as needed:

=OFFSET($D$1,,ROW(A1)-1)
--

HTH,

RD
==============================================
Please keep all correspondence within the Group, so all may benefit!
==============================================


"Paweł Gałecki" wrote in message
...
How can you make Excel to advance one row instead of one column?


For example you in A1 you have:
:=D1
One after draggin it one cell below (A2)i would like to have
:=E1
instead of
:=D2


any clue??


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
How do I sort by row instead of by column? PercivalMound Excel Worksheet Functions 7 August 28th 06 10:41 PM
Format cell in column B based on value in the next cell (column c) Nicole Excel Discussion (Misc queries) 7 May 18th 05 10:19 PM
How sum values in column B using values in column A as the conditi oldgrayelf Excel Worksheet Functions 5 February 4th 05 09:03 PM
Copying the contents of a column into a chart Richard Excel Worksheet Functions 1 November 16th 04 02:39 PM
How to calculate the data in excel 2002 including only the last 9. TylerMaricich Excel Worksheet Functions 6 November 8th 04 07:27 AM


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