Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 121
Default Worksheets Macro

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,124
Default Worksheets Macro

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 22,906
Default Worksheets Macro

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 121
Default Worksheets Macro

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 121
Default Worksheets Macro

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
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 do i reuse a Excel macro on another worksheets, global macro? Global Macro? Excel Programming 1 November 1st 06 04:50 PM
VBA / Macro for creating new worksheets and new columns from existing worksheets webby2006 Excel Programming 3 July 25th 06 03:38 PM
Problem in updating all worksheets of a workbook using a macro that calls another macro [email protected] Excel Programming 3 March 20th 06 05:21 AM
How can I get my macro to appear in ALL worksheets Roger Ottaway[_2_] Excel Programming 4 February 16th 05 01:17 PM
Macro for several worksheets JDP Excel Programming 3 December 31st 03 05:43 PM


All times are GMT +1. The time now is 02:22 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"