Solved

find row and then copy a range

Posted on 2013-06-05
3
244 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

SharePoint Admin?

Enable Your Employees To Focus On The Core With Intuitive Onscreen Guidance That is With You At The Moment of Need.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Access developers frequently have requirements to interact with Excel (import from or output to) in their applications.  You might be able to accomplish this with the TransferSpreadsheet and OutputTo methods, but in this series of articles I will di…
This article describes how to use a set of graphical playing cards to create a Draw Poker game in Excel or VB6.
This Micro Tutorial demonstrates how to create Excel charts: column, area, line, bar, and scatter charts. Formatting tips are provided as well.
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

695 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