View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
kingsdynasty kingsdynasty is offline
external usenet poster
 
Posts: 1
Default Help needed on program


A friend of mine wrote a program for me that would take 5 rows of
numbers and order them in one column with a space in between. Well I
would like to change the program so excel would place the numbers in
column B, not column A. I don't have much experience with programming,
so any help would be appreciated. Here is the code, run it if u please.
Thanks much

Dim RowNum As Integer
Dim ColNum As Integer
Dim MoreData As Boolean

MoreData = True
ColNum = 0
RowNum = 1
CellCount = 0
ColumnCount = 0
TotalColumns = 0

Worksheets("Sheet1").Activate

For Each C In Range("A1:IV5")
If C.Value < "" Then
CellCount = CellCount + 1
End If
Next C
ColumnCount = CellCount / 5

With Worksheets("Sheet1")
For ColNum = 1 To ColumnCount
RowNum = RowNum + 6
Range(Cells(1, ColNum), Cells(5, ColNum)).Select
Selection.Cut
Range(Cells(RowNum, 1), Cells((RowNum + 4), 1)).Select
ActiveSheet.Paste
Next ColNum
End With
End Sub


--
kingsdynasty
------------------------------------------------------------------------
kingsdynasty's Profile: http://www.excelforum.com/member.php...o&userid=24551
View this thread: http://www.excelforum.com/showthread...hreadid=381461