Help needed on program

K

kingsdynasty

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top