Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
Nev Nev is offline
external usenet poster
 
Posts: 20
Default Copy values of worksheet a to workbook b

Hi there

I really hope you can help. A macro wont work so hopefully you can!

I want to automate copying values only of Worksheet "si" in the current open
work book to worksheet "ys" in workbook Master Copy which may or may not be
open.

Look forward to hearing back

Thanks

Nev
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11,123
Default Copy values of worksheet a to workbook b

Start here (There is a example if the database sheet is in another workbook)
http://www.rondebruin.nl/copy1.htm

--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm




"Nev" wrote in message ...
Hi there

I really hope you can help. A macro wont work so hopefully you can!

I want to automate copying values only of Worksheet "si" in the current open
work book to worksheet "ys" in workbook Master Copy which may or may not be
open.

Look forward to hearing back

Thanks

Nev

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 248
Default Copy values of worksheet a to workbook b


Open both...
Copy 'si', switch to 'ys' in Master
Edit | Paste Special | Links | Paste Link

Save and close Master...
Whenever you open Master next, choose to update links...

"Nev" wrote:

Hi there

I really hope you can help. A macro wont work so hopefully you can!

I want to automate copying values only of Worksheet "si" in the current open
work book to worksheet "ys" in workbook Master Copy which may or may not be
open.

Look forward to hearing back

Thanks

Nev

  #4   Report Post  
Posted to microsoft.public.excel.misc
Nev Nev is offline
external usenet poster
 
Posts: 20
Default Copy values of worksheet a to workbook b

Hi Sheeloo

Thanks for this. I can do it manually but wanted to have it as a macro/vba
so that my data entry clerk can do it and not get it wrong!

Nev

"Sheeloo" wrote:


Open both...
Copy 'si', switch to 'ys' in Master
Edit | Paste Special | Links | Paste Link

Save and close Master...
Whenever you open Master next, choose to update links...

"Nev" wrote:

Hi there

I really hope you can help. A macro wont work so hopefully you can!

I want to automate copying values only of Worksheet "si" in the current open
work book to worksheet "ys" in workbook Master Copy which may or may not be
open.

Look forward to hearing back

Thanks

Nev

  #5   Report Post  
Posted to microsoft.public.excel.misc
Nev Nev is offline
external usenet poster
 
Posts: 20
Default Copy values of worksheet a to workbook b

Hi Ron

Not good with VBA but finally worked it out and it does just what I need.
Thanks.

I do have 1 problem and 1 question.

When I copy a cell which says 1 June 2009, after copying, it says 1 January
2009. The source cell is =DATE(YEAR(ys!D4)+C4,MONTH(ys!D4),DAY(ys!D4))

The formatting in source and destinantiuon is the same - English UK. This
is quite a critical point becaiuse the spreadsheet works off the dates.

My question is - how can I "Save As" after the transfer over.

I have modified the code to

Sub Copy_To_Another_Workbook()
Dim SourceRange As Range
Dim DestRange As Range
Dim DestWB As Workbook
Dim DestSh As Worksheet
Dim Lr As Long

With Application
.ScreenUpdating = False
.EnableEvents = False
End With

'Change the file name (2*) and the path/file name to your file
If bIsBookOpen_RB("Master Copy.xls") Then
Set DestWB = Workbooks("Master Copy.xls")
Else
Set DestWB = Workbooks.Open("C:\Nevs stuff\Back and front office
23-2-9\Block Management\Master Copy.xls")
End If

'Change the Source Sheet and range
Set SourceRange = ThisWorkbook.Sheets("si").Range("a1:t500")
'Change the sheet name of the database workbook
Set DestSh = DestWB.Worksheets("ys")



Set DestRange = DestSh.Range("a1:t500")

'We make DestRange the same size as SourceRange and use the Value
'property to give DestRange the same values
With SourceRange
Set DestRange = DestRange.Resize(.Rows.Count, .Columns.Count)
End With
DestRange.Value = SourceRange.Value



With Application
.ScreenUpdating = True
.EnableEvents = True
End With
End Sub


Many thanks in advance for your help - its invaluable

Nev


"Ron de Bruin" wrote:

Start here (There is a example if the database sheet is in another workbook)
http://www.rondebruin.nl/copy1.htm

--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm




"Nev" wrote in message ...
Hi there

I really hope you can help. A macro wont work so hopefully you can!

I want to automate copying values only of Worksheet "si" in the current open
work book to worksheet "ys" in workbook Master Copy which may or may not be
open.

Look forward to hearing back

Thanks

Nev




  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11,123
Default Copy values of worksheet a to workbook b

Hi Nev

Send me you workbook private so I can take a look

--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm




"Nev" wrote in message ...
Hi Ron

Not good with VBA but finally worked it out and it does just what I need.
Thanks.

I do have 1 problem and 1 question.

When I copy a cell which says 1 June 2009, after copying, it says 1 January
2009. The source cell is =DATE(YEAR(ys!D4)+C4,MONTH(ys!D4),DAY(ys!D4))

The formatting in source and destinantiuon is the same - English UK. This
is quite a critical point becaiuse the spreadsheet works off the dates.

My question is - how can I "Save As" after the transfer over.

I have modified the code to

Sub Copy_To_Another_Workbook()
Dim SourceRange As Range
Dim DestRange As Range
Dim DestWB As Workbook
Dim DestSh As Worksheet
Dim Lr As Long

With Application
.ScreenUpdating = False
.EnableEvents = False
End With

'Change the file name (2*) and the path/file name to your file
If bIsBookOpen_RB("Master Copy.xls") Then
Set DestWB = Workbooks("Master Copy.xls")
Else
Set DestWB = Workbooks.Open("C:\Nevs stuff\Back and front office
23-2-9\Block Management\Master Copy.xls")
End If

'Change the Source Sheet and range
Set SourceRange = ThisWorkbook.Sheets("si").Range("a1:t500")
'Change the sheet name of the database workbook
Set DestSh = DestWB.Worksheets("ys")



Set DestRange = DestSh.Range("a1:t500")

'We make DestRange the same size as SourceRange and use the Value
'property to give DestRange the same values
With SourceRange
Set DestRange = DestRange.Resize(.Rows.Count, .Columns.Count)
End With
DestRange.Value = SourceRange.Value



With Application
.ScreenUpdating = True
.EnableEvents = True
End With
End Sub


Many thanks in advance for your help - its invaluable

Nev


"Ron de Bruin" wrote:

Start here (There is a example if the database sheet is in another workbook)
http://www.rondebruin.nl/copy1.htm

--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm




"Nev" wrote in message ...
Hi there

I really hope you can help. A macro wont work so hopefully you can!

I want to automate copying values only of Worksheet "si" in the current open
work book to worksheet "ys" in workbook Master Copy which may or may not be
open.

Look forward to hearing back

Thanks

Nev


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
Macro to copy values to Workbook KCG Excel Discussion (Misc queries) 10 November 6th 07 10:52 PM
copy all and paste values for all sheets in a workbook cass calculator Excel Worksheet Functions 6 June 1st 07 02:58 PM
how to copy only values and formats of worksheets to new workbook rvd Excel Worksheet Functions 3 January 31st 07 12:43 PM
Copy Data from Workbook into specific Worksheet in other Workbook? kingdt Excel Discussion (Misc queries) 1 March 16th 06 06:55 PM
copy worksheet from closed workbook to active workbook using vba mango Excel Worksheet Functions 6 December 9th 04 07:55 AM


All times are GMT +1. The time now is 03:20 AM.

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"