Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default Looping Paste Special Value Transpose

I am trying to create a macro that will loop through list of items containing
4 columns and Paste Special Values Transpose into a Single column on a blank
worksheet. My problem is that Col C & D are blanks, so I need to step down 4
rows with each paste.

PartNo-Qty-Blank1-Blank2

I need it to be:

PartNo
Qty
Blank1
Blank2
PartNo
Qty
Blank1
Blank2
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,939
Default Looping Paste Special Value Transpose

This should be close. It takes all of the cells in sheet1 columns A and B amd
copies them to Sheet2 column A in the manner you describe...

Sub test()
Dim rngFrom As Range
Dim rngTo As Range
Dim rng As Range

With Sheets("Sheet1")
Set rngFrom = .Range(.Range("A2"), .Cells(Rows.Count, "A").End(xlUp))
End With

Set rngTo = Sheets("Sheet2").Range("A2")

For Each rng In rngFrom
rngTo.Value = rng.Value
rngTo.Offset(1, 0).Value = rng.Offset(0, 1).Value
Set rngTo = rngTo.Offset(4, 0)
Next rng

End Sub
--
HTH...

Jim Thomlinson


"AncientLearner" wrote:

I am trying to create a macro that will loop through list of items containing
4 columns and Paste Special Values Transpose into a Single column on a blank
worksheet. My problem is that Col C & D are blanks, so I need to step down 4
rows with each paste.

PartNo-Qty-Blank1-Blank2

I need it to be:

PartNo
Qty
Blank1
Blank2
PartNo
Qty
Blank1
Blank2

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default Looping Paste Special Value Transpose

Wow...I am in heaven after countless hours of frustration.
Thank you from the bottom of my old heart :) Fabulous!
--
AncientLearner
....never to old to learn something new


"Jim Thomlinson" wrote:

This should be close. It takes all of the cells in sheet1 columns A and B amd
copies them to Sheet2 column A in the manner you describe...

Sub test()
Dim rngFrom As Range
Dim rngTo As Range
Dim rng As Range

With Sheets("Sheet1")
Set rngFrom = .Range(.Range("A2"), .Cells(Rows.Count, "A").End(xlUp))
End With

Set rngTo = Sheets("Sheet2").Range("A2")

For Each rng In rngFrom
rngTo.Value = rng.Value
rngTo.Offset(1, 0).Value = rng.Offset(0, 1).Value
Set rngTo = rngTo.Offset(4, 0)
Next rng

End Sub
--
HTH...

Jim Thomlinson


"AncientLearner" wrote:

I am trying to create a macro that will loop through list of items containing
4 columns and Paste Special Values Transpose into a Single column on a blank
worksheet. My problem is that Col C & D are blanks, so I need to step down 4
rows with each paste.

PartNo-Qty-Blank1-Blank2

I need it to be:

PartNo
Qty
Blank1
Blank2
PartNo
Qty
Blank1
Blank2

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
Transpose, Paste Special idgity Excel Discussion (Misc queries) 2 September 6th 07 06:04 PM
Paste Special / transpose Ron Carr Excel Discussion (Misc queries) 2 February 24th 06 06:13 PM
When I special paste and transpose.... sml New Users to Excel 4 January 12th 06 12:49 AM
Paste Special Transpose Brian Excel Programming 1 August 29th 05 03:43 PM
Need help with Transpose paste special Paul Excel Programming 4 December 5th 04 10:00 PM


All times are GMT +1. The time now is 05:38 PM.

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

About Us

"It's about Microsoft Excel"