Solved

copy data from single cell into merged different wkbs

Posted on 2013-06-03
5
568 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
ID: 39216504
The process has to be repeat 500 times single cell to merged
0
 
LVL 33

Accepted Solution

by:
Norie earned 500 total points
ID: 39216722
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
ID: 39217337
Thanks for the feedback
0
 

Author Comment

by:route217
ID: 39218208
Excellent imnorie. ....
0
 

Author Comment

by:route217
ID: 39218212
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Introduction While answering a recent question (http:/Q_27311462.html), I created an alternative function to the Excel Concatenate() function that you might find useful.  I tested several solutions and share the results in this article as well as t…
Improved? Move/Copy Add-in Replacement - How to avoid the annoying, “A formula or sheet you want to move or copy contains the name XXX, which already exists on the destination worksheet.” David Miller (dlmille)  It was one of those days… I wa…
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 will demonstrate how to create pivot charts out of a data set. I also added a drop-down menu which allows to choose from different categories in the data set and the chart will automatically update.

911 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

23 Experts available now in Live!

Get 1:1 Help Now