LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming,microsoft.public.excel.worksheetfunctions,microsoft.public.excel.charting,microsoft.public.word.vba.general
external usenet poster
 
Posts: 4
Default Visual Basic Macros, relative position

Dear Experts,

I am making a report, and I have a set of data, in a very looong row:

MKT_VAL NET_ASSETS TOT_ASSETS
46 51 51
6233 6228 6228


Over 100 fields.

I need this data to be changed to run down a column.


MKT_VAL
46
6233


NET_ASSETS
51
6228


TOT_ASSETS
51
6228


I tried to make a macro to do this.
It would be run after I copied and pasted the three column cells into
another area.


Sub ShiftNullData()
'
' ShiftNullData Macro
' Macro recorded 11/14/2006 by Rodger Lepinsky
'
' Keyboard Shortcut: Ctrl+q
'
Range("A18").Select
Selection.Copy
Application.CutCopyMode = False
Selection.Cut
Range("B17").Select
ActiveSheet.Paste
Range("A19").Select
Selection.Cut
Range("C17").Select
ActiveSheet.Paste
Range("B17").Select
End Sub


However, it is working on the hard coded position. A18, B17, etc.

How can I get the macro to work from whereever it starts?


Alternatively, is there a way to pivot all this, with no kinds of
summaries, etc?



Thanks!

 
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
Visual Basic Macros Mia Skier Excel Discussion (Misc queries) 3 June 8th 08 04:12 AM
Visual Basic Macros, relative position [email protected] Charts and Charting in Excel 3 November 14th 06 11:33 PM
Help on Macros, Excel, Visual Basic at Yahoo group Bawatchers Enda Excel Programming 0 August 15th 05 09:54 AM
Visual Basic - Macros Kanga Excel Programming 2 July 12th 05 09:27 AM
how to write visual basic macros Ken Michaels Excel Programming 1 November 2nd 04 03:38 PM


All times are GMT +1. The time now is 06:51 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"