Solved

find row and then copy a range

Posted on 2013-06-05
3
236 Views
Last Modified: 2013-06-08
In Sheet "B", I have a table. In the Sheet "A" I have a summary sheet. I would like a macro that selects a defined row in Sheet "B" and then copies(transposes) a range in that row to a defined range in Sheet "A".
The row is defined by inserting the row number in cell "A1" in Sheet "A". Then I will run the macro manually.
Examples:
Sheet "A" cell A1 :  insert the number 5.
Then in Sheet "B", range A5:G5, Select
Sheet "A", range C1:C8. paste/Transpose

Sheet "A" cell A1 :  insert the number 10.
Then in Sheet "B", range A10:G10, Select
Sheet "A", range C1:C8. paste/Transpose

Sheet "A" cell A1 :  insert the number 22.
Then in Sheet "B", range A22:G22, Select
Sheet "A", range C1:C8. paste/Transpose


Thanks
CC
0
Comment
Question by:CC10
  • 2
3 Comments
 

Accepted Solution

by:
psmitty earned 400 total points
ID: 39224036
Sub Macro x
Dim i
 i = ActiveSheet.Cells(1,1).Value
 Range("A" & i ":G" & i).Select
 Selection.Copy
 Sheets("Sheet B").Select
 Range("C1").Select
 Selection.PasteSpecial Paste:=xlPasteAll, Operation:=xlNone, SkipBlanks:=False,  Transpose:=True
End Sub

Open in new window

0
 

Author Comment

by:CC10
ID: 39225051
This does not seem to work. Is the separator correct in the Range statement?

Also, the range to be copied is in Sheet B and then that should be pasted back into Sheet A in Range(C1)

The single cell to determine the row number in Sheet "B",  is Sheet"A". Cell(1,1)
The range is Sheet B, row i,A:G
It is pasted back into Sheet A, cell C1

Thanks
0
 

Author Closing Comment

by:CC10
ID: 39231946
Have solved it. The range statement was incorrect.
0

Featured Post

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

Suggested Solutions

Drop Down List with Unique/Distinct Values (Part II - ComboBox or ListBox and Data Validation List Bonus!) David Miller (dlmille) Intro This article focuses on delivering unique, sorted lists to list objects (e.g., ComboBox, ListBox) and Dat…
Introduction This Article briefly covers methods of calculating the NPV and IRR variants in Excel as well as the limitations in calculating and interpreting IRR results. Paraphrasing Richard Shockley, author of my favourite finance reference tex…
The view will learn how to download and install SIMTOOLS and FORMLIST into Excel, how to use SIMTOOLS to generate a Monte Carlo simulation of 30 sales calls, and how to calculate the conditional probability based on the results of the Monte Carlo …
This Micro Tutorial will demonstrate the scrolling table in Microsoft Excel using the INDEX function.

708 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now