Scrape Data from Columns and Paste Into Rows

largeselection

Active Member
Joined
Aug 4, 2008
Messages
358
Hi All -

Hope this is an easy question. I'm basically scraping data from an input sheet into a data sheet and it works great as long as the ranges I'm using are all rows, but it fails when I am trying to scrape the data into columns when the source is in rows. For example,

VBA Code:
 .Range(.Cells(x, 8), .Cells(x, 18)).Value = Range(Sheets(s.Value).Cells(c.Row, 3), Sheets(s.Value).Cells(c.Row, 13)).Value

works great because I'm taking stuff in columns and setting it in other columns, but the below fails. How do I correct it?

Code:
.Range(.Cells(x, 4), .Cells(x, 7)).Value = Range(Sheets(s.Value).Cells(6, c.Column), Sheets(s.Value).Cells(9, c.Column)).Value

Thanks!
 

Excel Facts

Square and cube roots
The =SQRT(25) is a square root. For a cube root, use =125^(1/3). For a fourth root, use =625^(1/4).
To put column data into a row Try:

VBA Code:
.Range(.Cells(x, 4), .Cells(x, 7)).Value = Application.Transpose(Range(Sheets(s.Value).Cells(6, c.Column), Sheets(s.Value).Cells(9, c.Column)).Value)
 
Upvote 0
Solution
To put column data into a row Try:

VBA Code:
.Range(.Cells(x, 4), .Cells(x, 7)).Value = Application.Transpose(Range(Sheets(s.Value).Cells(6, c.Column), Sheets(s.Value).Cells(9, c.Column)).Value)
Thank you that was a total brain fart on my end. I had originally tried putting Transpose around it, but forgot "Application." before it so it didn't work. THANKS
 
Upvote 0

Forum statistics

Threads
1,223,914
Messages
6,175,351
Members
452,638
Latest member
Oluwabukunmi

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top