Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default PasteSpeacial - transpose


Hi all

I am new to vba, and am having problems transposing data. This i
supposed to select a column of data ( until there is a blank cell)
copy and then attempt to paste / transpose into cell B2 on the sam
sheet. All works except for the paste line.Please would someon
explain why it does not work?

Thanks


Sub SelectWithoutBlanks()

Dim j As Integer
Do
j = j + 1
'Debug.Print j
If ActiveSheet.Cells(j, 1).Value = "" Then Exit Do
Loop

ActiveSheet.Range(Cells(1, 1), Cells(j - 1, 1)).Select
ActiveSheet.Range(Cells(1, 1), Cells(j - 1, 1)).Copy
MsgBox ("Range Selected")

ActiveSheet.Cells(1, 2).Select
ActiveSheet.PasteSpecial Transpose:=True
End Su

--
Willo
-----------------------------------------------------------------------
Willow's Profile: http://www.excelforum.com/member.php...fo&userid=1607
View this thread: http://www.excelforum.com/showthread.php?threadid=27523

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default PasteSpeacial - transpose

There are two forms of pastespecial. The one that has transpose as argument
is a method of a range object. This works (as long as j is less than 256)

Sub SelectWithoutBlanks()

Dim j As Integer
Do
j = j + 1
'Debug.Print j
If ActiveSheet.Cells(j, 1).Value = "" Then Exit Do
Loop

ActiveSheet.Range(Cells(1, 1), Cells(j - 1, 1)).Select
ActiveSheet.Range(Cells(1, 1), Cells(j - 1, 1)).Copy
MsgBox ("Range Selected")

ActiveSheet.Cells(1, 2).PasteSpecial Transpose:=True
End Sub

--
Regards,
Tom Ogilvy

"Willow" wrote in message
...

Hi all

I am new to vba, and am having problems transposing data. This is
supposed to select a column of data ( until there is a blank cell),
copy and then attempt to paste / transpose into cell B2 on the same
sheet. All works except for the paste line.Please would someone
explain why it does not work?

Thanks


Sub SelectWithoutBlanks()

Dim j As Integer
Do
j = j + 1
'Debug.Print j
If ActiveSheet.Cells(j, 1).Value = "" Then Exit Do
Loop

ActiveSheet.Range(Cells(1, 1), Cells(j - 1, 1)).Select
ActiveSheet.Range(Cells(1, 1), Cells(j - 1, 1)).Copy
MsgBox ("Range Selected")

ActiveSheet.Cells(1, 2).Select
ActiveSheet.PasteSpecial Transpose:=True
End Sub


--
Willow
------------------------------------------------------------------------
Willow's Profile:

http://www.excelforum.com/member.php...o&userid=16070
View this thread: http://www.excelforum.com/showthread...hreadid=275233



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Need transpose? help.... Jethro Bodeene Excel Worksheet Functions 9 March 17th 10 08:35 PM
Transpose Niklas Nilsson Excel Worksheet Functions 2 September 20th 09 01:18 AM
Transpose from last to first Angela Excel Discussion (Misc queries) 5 April 9th 08 09:13 PM
transpose kortrijkzaantje Excel Worksheet Functions 3 September 28th 05 08:00 PM
I WANT TO TRANSPOSE LINKS, AS WE TRANSPOSE VALUES Umair Aslam Excel Worksheet Functions 1 September 22nd 05 01:19 PM


All times are GMT +1. The time now is 03:00 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"