Solved

copy data from single cell into merged different wkbs

Posted on 2013-06-03
5
582 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

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

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

Suggested Solutions

Title # Comments Views Activity
Name Selection and Sorting 43 92
Excel vba question 7 43
Excel formula that extracts out name of url 6 42
Search for a certain number and select cells using VBA 9 19
Freeze panes is an option within all variants of Excel to enable parts of a sheet to remain stationary when the cursor is in another part of the sheet. This is a very useful feature which is overlooked or under used.
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…
Graphs within dashboards are meant to be dynamic, representing data from a period of time that will change each time the dashboard is updated with new data. Rather than update each graph to point to a different set within a static set of data, t…
Many functions in Excel can make decisions. The most simple of these is the IF function: it returns a value depending on whether a condition you describe is true or false. Once you get the hang of using the IF function, you will find it easier to us…

749 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