View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.misc
JMB JMB is offline
external usenet poster
 
Posts: 2,062
Default Array Manipulation with VBA coding

Some info on referencing ranges here that may be worth a look. Of course,
there is much else to learn about referencing ranges.
http://cpearson.com/excel/cells.htm

If your data is important - be sure to backup before trying because VBA does
not have a built in undo feature.

Sub test()
Dim i As Long

For i = 1 To 12
Range(Cells(1, i * 2 + 1), Cells(Rows.Count, _
i * 2 + 1).End(xlUp)).Resize(, 2).Cut _
Cells(Rows.Count, 1).End(xlUp)(2, 1)
Next i

End Sub




"Joe" wrote:

I have large array which I would like to manipulate by VBA macros.

The array size is A1:Z100 ( 26 columns X 100 rows)

The data in A:column (text) and in B:column (numeric) are related to each
other.
That is paired to each other.
Likewise in C: (text) and in D: (numeric) and so on until Y: Z:

There are however blanks in both corresponding columns at the end of some
rows.

I need to move each pair of columns sequentially starting with C: D:
..........down to Y:Z:
underneath A: and B:

Being brand new to VBA, until this week (thanks goes to JMB for introducing
me to VBA...I have discovered the VBA language manual) I am still struggling
with the synatx.