Transposing a rng selected from a listbox

J

JoeH

Hi there,

I need some more help transposing the following the following: I'v
pasted the whole part so you can see how i am getting my info:

Set rng = Range(progListBox.RowSource).Columns(1).Cells
cl = rng.Offset(progListBox.ListIndex, 0).Row
With Workbooks("bonddb.xls").Worksheets("database")

Load:
Range("Issr") = .Cells(cl, 1)
Range("Issr_local") = .Cells(cl, 2)
Range("Principal") = .Cells(cl, 4)
Range("Term") = .Cells(cl, 7)

*** .Columns("EE:GL").Rows(cl).Copy _

Destination:=Workbooks("bsapp_v2.xls").Worksheets("bsmain").Rows(33).Columns("C"
***

End With

*** is the code that i need to transposed from a row to a column whe
it is pasted. I have tried many different combos of the paste specia
function and rearranging things but all i am able to generate ar
errors. I hope my question makes sense.

Thanks in adv for your help.
Jo
 
T

Tom Ogilvy

.Columns("EE:GL").Rows(cl).Copy _

Workbooks("bsapp_v2.xls").Worksheets("bsmain").Cells("C33"). _
PasteSpecial xlPasteAll, Transpose:=True
 
J

JoeH

Tom,

I used what you put in and got an expected: end of statement error s
i put parens () around the xlpasteall, transpose and deleted the semico
: replayed and resulted in a type mismatch error. if it helps any m
VBA ver is listed as 6.3

Thanks for the quick reply
Sorry to be such a bother
Jo
 
T

Tom Ogilvy

I edited you code, so I didn't get it completely cleaned up.

I neglected to delete the line continuation character on the end of the copy
command and I had Cells("C33") with the cells left over from the original.
It should have been changed to Range("C33")

so the correction should have been

.Columns("EE:GL").Rows(cl).Copy

Workbooks("bsapp_v2.xls").Worksheets("bsmain").Range("C33"). _
PasteSpecial xlPasteAll, Transpose:=True


Just to give you a sense of reassurance, this worked fine:

Sub AABBCC()
cl = 100
With Workbooks("bonddb.xls").Worksheets("database")
.Columns("EE:GL").Rows(cl).Copy
End With
Workbooks("bsapp_v2.xls").Worksheets("bsmain").Range("C33"). _
PasteSpecial xlPasteAll, Transpose:=True

End Sub
 
J

JoeH

!!!!! Thanks

Tom,

Where do i send the check :)
Sometimes i really hate being a novice. But with your help lately I'l
be able to figure this out alot quicker.

Thanks again

Joe Helferic
 

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