Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I am trying to create a code that, when I run it from Sheet 1, it will
1. Clear the contents in cells C10 and E10 on Sheet 2 2. Copy the contents in cells C7 and E7 on Sheet1 3. Paste the contents from cells C7 and E7 on Sheet 1 into C10 and E10 on Sheet 2 4. Finish with Sheet 2 as the active worksheet. Can you help me out with this? |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Something like
with sheets("sheet2") sheets("sheet1").copy range("c7").range("c10) sheets("sheet1").copy range("e7").range("e10) 'uncomment line below to activate sheet2 ..select end with -- Don Guillett Microsoft MVP Excel SalesAid Software "Workbook" wrote in message ... I am trying to create a code that, when I run it from Sheet 1, it will 1. Clear the contents in cells C10 and E10 on Sheet 2 2. Copy the contents in cells C7 and E7 on Sheet1 3. Paste the contents from cells C7 and E7 on Sheet 1 into C10 and E10 on Sheet 2 4. Finish with Sheet 2 as the active worksheet. Can you help me out with this? |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
You can run this from any sheet.
Sub copy() Sheets("Sheet2").Range("C10", "E10").Value = _ Sheets("Sheet1").Range("C7", "E7").Value Sheets("Sheet2").Activate End Sub No need to clear/copy/paste. Gord Dibben MS Excel MVP On Tue, 7 Oct 2008 15:37:02 -0700, Workbook wrote: I am trying to create a code that, when I run it from Sheet 1, it will 1. Clear the contents in cells C10 and E10 on Sheet 2 2. Copy the contents in cells C7 and E7 on Sheet1 3. Paste the contents from cells C7 and E7 on Sheet 1 into C10 and E10 on Sheet 2 4. Finish with Sheet 2 as the active worksheet. Can you help me out with this? |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thank you Don. My apologies for the delay. This was very helpful.
"Don Guillett" wrote: Something like with sheets("sheet2") sheets("sheet1").copy range("c7").range("c10) sheets("sheet1").copy range("e7").range("e10) 'uncomment line below to activate sheet2 ..select end with -- Don Guillett Microsoft MVP Excel SalesAid Software "Workbook" wrote in message ... I am trying to create a code that, when I run it from Sheet 1, it will 1. Clear the contents in cells C10 and E10 on Sheet 2 2. Copy the contents in cells C7 and E7 on Sheet1 3. Paste the contents from cells C7 and E7 on Sheet 1 into C10 and E10 on Sheet 2 4. Finish with Sheet 2 as the active worksheet. Can you help me out with this? |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thank you Gord. I also appreciate your help very much. I am sorry for the
delay. The code was very helpful to me. Thank you. "Gord Dibben" wrote: You can run this from any sheet. Sub copy() Sheets("Sheet2").Range("C10", "E10").Value = _ Sheets("Sheet1").Range("C7", "E7").Value Sheets("Sheet2").Activate End Sub No need to clear/copy/paste. Gord Dibben MS Excel MVP On Tue, 7 Oct 2008 15:37:02 -0700, Workbook wrote: I am trying to create a code that, when I run it from Sheet 1, it will 1. Clear the contents in cells C10 and E10 on Sheet 2 2. Copy the contents in cells C7 and E7 on Sheet1 3. Paste the contents from cells C7 and E7 on Sheet 1 into C10 and E10 on Sheet 2 4. Finish with Sheet 2 as the active worksheet. Can you help me out with this? |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
How do i reuse a Excel macro on another worksheets, global macro? | Excel Programming | |||
VBA / Macro for creating new worksheets and new columns from existing worksheets | Excel Programming | |||
Problem in updating all worksheets of a workbook using a macro that calls another macro | Excel Programming | |||
How can I get my macro to appear in ALL worksheets | Excel Programming | |||
Macro for several worksheets | Excel Programming |