Solved

copy data from single cell into merged different wkbs

Posted on 2013-06-03
5
559 Views
Last Modified: 2013-06-04
Hi experts

how would you copy data in workbook 1, worksheet 1 cell a2 into workbook 2 worksheet 1 merged cells a2:a10 and then cell a3 wkb1 into merged cells a11:a19 wkb2...
0
Comment
Question by:route217
  • 4
5 Comments
 

Author Comment

by:route217
Comment Utility
The process has to be repeat 500 times single cell to merged
0
 
LVL 33

Accepted Solution

by:
Norie earned 500 total points
Comment Utility
Try this, change workbook, worksheet names as needed.
Sub CopyToMergedCells()
Dim wb1 As Workbook
Dim wb2 As Workbook
Dim rngSrc As Range
Dim rngDst As Range

       Set wb1 = Workbooks("Book1")
       Set wb2 = Workbooks("Book2")

       Set rngSrc = wb1.Worksheets("Sheet1").Range("A2")
       Set rngDst = wb2.Worksheets("Sheet1").Range("A2")

       Do Until rngSrc.Value = ""
            rngDst.Value = rngSrc.Value
            Set rngSrc = rngSrc.Offset(1)
            Set rngDst = rngDst.Offset(1)
       Loop

End Sub

Open in new window

0
 

Author Comment

by:route217
Comment Utility
Thanks for the feedback
0
 

Author Comment

by:route217
Comment Utility
Excellent imnorie. ....
0
 

Author Comment

by:route217
Comment Utility
0

Featured Post

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

A2 = A1 That kind of cell reference is relative.  If you copy it from A2 to B2, then B2 will get this: B2 = B1 That's all fine and good, but if you then insert a new row above row 2, you'll find: A3 = A1 B3 = B1 This is intentional. …
Drop Down List with Unique/Distinct Values (enhancing the Combo-Box with a few steps and a little code) David miller (dlmille) Intro Have you ever created a data validation list from a database field or spreadsheet column (e.g., Zip Codes or Co…
This Micro Tutorial demonstrates how to create Excel charts: column, area, line, bar, and scatter charts. Formatting tips are provided as well.
This Micro Tutorial demonstrates in Microsoft Excel how to consolidate your marketing data by creating an interactive charts using form controls. This creates cool drop-downs for viewers of your chart to choose from.

772 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

11 Experts available now in Live!

Get 1:1 Help Now