Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Greetings,
I need to use a macro to copy cell values from one sheet to anothe without changing the sheet that's in view. I have been using th following code but my selection method causes the sheet in view to fli back and forth between the sheet the cells are being copied from to th one they are being pasted on. I am using the follwing: Sheets("Sheet1Name").Select Range("D4").Select Selection.Copy Sheets("Sheet2Name").Select Range("C5").Select ActiveSheet.Paste How can I rewrite this to do all the work in the background? I guess need the syntax to copy a range from a sheet without making i "Active". Thanks in advance! -- Message posted from http://www.ExcelForum.com |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Sheets("Sheet1Name").Range("D4").Copy Destination:= _
Sheets("Sheet2Name").Range("C5") -- HTH Bob Phillips ... looking out across Poole Harbour to the Purbecks (remove nothere from the email address if mailing direct) "William DeLeo " wrote in message ... Greetings, I need to use a macro to copy cell values from one sheet to another without changing the sheet that's in view. I have been using the following code but my selection method causes the sheet in view to flip back and forth between the sheet the cells are being copied from to the one they are being pasted on. I am using the follwing: Sheets("Sheet1Name").Select Range("D4").Select Selection.Copy Sheets("Sheet2Name").Select Range("C5").Select ActiveSheet.Paste How can I rewrite this to do all the work in the background? I guess I need the syntax to copy a range from a sheet without making it "Active". Thanks in advance!! --- Message posted from http://www.ExcelForum.com/ |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
As easy as that is, I was having trouble figuring out the syntax.
I appreciate your help very much. Thank you -- Message posted from http://www.ExcelForum.com |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Try this William
Sub test() Sheets("Sheet1Name").Range("D4").Copy _ Sheets("Sheet2Name").Range("C5") End Sub -- Regards Ron de Bruin http://www.rondebruin.nl "William DeLeo " wrote in message ... Greetings, I need to use a macro to copy cell values from one sheet to another without changing the sheet that's in view. I have been using the following code but my selection method causes the sheet in view to flip back and forth between the sheet the cells are being copied from to the one they are being pasted on. I am using the follwing: Sheets("Sheet1Name").Select Range("D4").Select Selection.Copy Sheets("Sheet2Name").Select Range("C5").Select ActiveSheet.Paste How can I rewrite this to do all the work in the background? I guess I need the syntax to copy a range from a sheet without making it "Active". Thanks in advance!! --- Message posted from http://www.ExcelForum.com/ |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I see that you are not using the Paste command at all ... how would you
advice apply if I were using paste special -- Message posted from http://www.ExcelForum.com |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Use something like this
Sub test() Sheets("Sheet1Name").Range("D4").Copy Sheets("Sheet2Name").Range("C5").PasteSpecial xlPasteValues, , False, False Application.CutCopyMode = False End Sub -- Regards Ron de Bruin http://www.rondebruin.nl "William DeLeo " wrote in message ... I see that you are not using the Paste command at all ... how would your advice apply if I were using paste special? --- Message posted from http://www.ExcelForum.com/ |
#7
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
How to look up and copy a changing range of data ? | New Users to Excel | |||
range of Formula copy but not changing the content | Excel Discussion (Misc queries) | |||
How to copy range without changing formulas? | Excel Discussion (Misc queries) | |||
Copy formula into multiple cells without changing range | Excel Worksheet Functions | |||
How do you copy RANK w/o it changing the range? | Excel Worksheet Functions |