?
Solved

copy data from single cell into merged different wkbs

Posted on 2013-06-03
5
Medium Priority
?
611 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
[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
  • 4
5 Comments
 

Author Comment

by:route217
ID: 39216504
The process has to be repeat 500 times single cell to merged
0
 
LVL 34

Accepted Solution

by:
Norie earned 2000 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

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

How to get Spreadsheet Compare 2016 working with the 64 bit version of Office 2016
In Part II of this series, I will discuss how to identify all open instances of Excel and enumerate the workbooks, spreadsheets, and named ranges within each of those instances.
This Micro Tutorial will demonstrate on a Mac how to change the sort order for chart legend values and decrpyt the intimidating chart menu.
This Micro Tutorial will demonstrate how to use longer labels with horizontal bar charts instead of the vertical column chart.

743 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