View Single Post
  #16   Report Post  
Posted to microsoft.public.excel.programming
joel joel is offline
external usenet poster
 
Posts: 9,101
Default I want to transfer data in a list based on value to an other w

Clear the destination worksheet and re-run the macro. I think the numbers
less the 1 was left over from a previous run of the macro.

"Mully911" wrote:

Joel,
I really ,really appreciate you helping me with this!!

This is AWESOME!! It works good but still puts numbers less than zero at the
top of some columns where the list had more than 1 number less than 0 at the
end of the data?? I guess they could be negative numbers....??
TNX
Mully

"Joel" wrote:

Remember to change the Workbook and Sheet name. I made the changes and found
the error in the code.


Sub MakeColumns()

Set OldSht = ThisWorkbook.Sheets("Sheet1")
Set NewSht = Workbooks("Book1").Sheets("Sheet4")

LastCol = NewSht.Cells(1, Columns.Count).End(xlToLeft).Column
NewCol = LastCol + 1

RowCount = 1
Start = RowCount
With OldSht
Do While .Range("B" & RowCount) < ""
If .Range("B" & RowCount) = 1 Then
If .Range("B" & (RowCount + 1)) < 1 Or _
.Range("B" & (RowCount + 1)) = "" Then

.Range("B" & Start & ":B" & RowCount).Copy _
Destination:=NewSht.Cells(1, NewCol)
NewCol = NewCol + 1
RowCount = RowCount + 2
Start = RowCount
Else
RowCount = RowCount + 1
End If
Else
RowCount = RowCount + 1
Start = RowCount
End If
Loop

End With

End Sub


"Mully911" wrote:

Hi Joel,

I have it running again, but it still has numbers less than 1.0--- say 0.121
at the top of some columns after it is complete??

Also I have many separate workbooks containing these data sets in the same
format and I wish to add each to the same "Master Sheet"

So if I add 10 sets of data from 1 book using the sweeet code you created ,I
would like to add the next 10 sets right after the prev set to build a huge
table.
Is this possible?

Thanks again!!!!
Mully

"Mully911" wrote:


Hi Joel,
I closed Excel and now I get "security is too high or unsigned" I tried to
lower security but nothing happens??
Any thoughts??
Thanks!
Mully

"Joel" wrote:

I missed 1 change from A to B

from:
.Range("B" & Start & ":A" & RowCount).Copy _
to
.Range("B" & Start & ":B" & RowCount).Copy _

The code is copying both A and B and I think the A data is clearing out th B
data that was transfered. It is impossible for the code to write to column L
without first writing to columns B - K.


"Mully911" wrote:

I have recorded number data in a large list. The data contains individual
recordings seperated by data values less than 1.
In other words each set of data(each recording) is seperated by a value less
than 1.

Example:
18
17
16
.03
19
18
16
.05
I want to copy each data set to another work book and place it in the next
column one after the other.

Here is how I would like the data in the second workbook to look
18 19
17 18
16 16
I could really use some help with this I am new to programming.

Thanks in advance
Mully