Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 155
Default Copy & paste ranges from 1 wkbk to another

Hi everyone,

I have a workbook that I have set up with formulas, data validation, cond
formatting and macros. Now I need to make a copy of this in another language.
I have the translations set up in exactly the same cells in another workbook
(Source) so I thought the easiest option would be to copy ranges from Source
to Original (Destination). I need to paste as values because the destination
wkbk has conditional formatting.

There are 25 worksheets and the ranges are all odd row starting from 3 going
to between 20 and 25 covering columns A-M. There are a further 7 worksheets
with different information that would probably be easier to amend by hand.

If someone could help me to get started on this it would be brilliant. I was
wondering whether I could use input box to specify which sheets in each
workbook?

Thank you

--
Deirdre
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9,101
Default Copy & paste ranges from 1 wkbk to another

Sub TranslateData()

Set OldBk = ThisWorkbook

filetoOpen = Application _
.GetOpenFilename("Excel Files (*.xls), *.xls")
If filetoOpen = False Then
MsgBox ("Cannot OPen file - Exiting Macro")
Exit Sub
End If

Set TransBk = Workbooks.Open(Filename:=filetoOpen)

For Each OldSht In OldBk.Sheets
Set TransSht = TransBk.Sheets(OldSht.Name)
LastRow = OldSht.Range("A" & Rows.Count).End(xlUp).Row
For RowCount = 3 To LastRow Step 2
OldSht.Range("A" & RowCount & ":M" & RowCount).Copy _
Destination:=TransSht.Range("A" & RowCount)
Next RowCount
Next OldSht
End Sub


"Diddy" wrote:

Hi everyone,

I have a workbook that I have set up with formulas, data validation, cond
formatting and macros. Now I need to make a copy of this in another language.
I have the translations set up in exactly the same cells in another workbook
(Source) so I thought the easiest option would be to copy ranges from Source
to Original (Destination). I need to paste as values because the destination
wkbk has conditional formatting.

There are 25 worksheets and the ranges are all odd row starting from 3 going
to between 20 and 25 covering columns A-M. There are a further 7 worksheets
with different information that would probably be easier to amend by hand.

If someone could help me to get started on this it would be brilliant. I was
wondering whether I could use input box to specify which sheets in each
workbook?

Thank you

--
Deirdre

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How can I copy big ranges of cells without drag or copy/paste? Ricardo Julio Excel Discussion (Misc queries) 3 March 23rd 10 02:38 PM
Copy sheets from source wkbk to another wkbk Diddy Excel Programming 0 August 21st 08 01:48 PM
copy and paste data to last used row wkbk Junior728 Excel Programming 3 May 11th 07 01:26 PM
Copy and paste Named Ranges Robert H Excel Programming 6 February 6th 07 04:13 PM
Copy paste WkBk/sheet 1 to multiple wkbks/sheets wrpalmer Excel Programming 1 August 20th 05 03:08 PM


All times are GMT +1. The time now is 11:54 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"