LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 115
Default Copying cells from on sheet to another sheet (via sheet module)

I am trying to code that when a cell is selected it copies the cell range
N3:Q242 from sheet x to the same cell range on the current sheet. With the
code below, I receive a error:
Run-time error 1004
Select method of Range class failed.

Private Sub Worksheet_SelectionChange(ByVal Target As Range)

If Target.Address = "$K$1" Then

Sheets("ProgramSummaryTemplate").Select
Range("N3:Q242").Select
Selection.Copy
Sheets("ProgramSummary").Select
Range("N3:Q242").Select
Selection.PasteSpecial

End If

Cancel = True
End Sub

Also, what is the syntax for the target to become the active worksheet
instead of being hard coded.
 
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
Need help Taking alot data from one sheet (if not blank) and copying toa list on another sheet. Alex Zuniga Excel Worksheet Functions 1 November 25th 09 11:54 PM
Copying the repeated data of the previous sheet to the next sheet Sasikiran Excel Discussion (Misc queries) 1 September 25th 07 03:18 PM
Dynamic column chart - copying from Sheet to Sheet. Marko Pinteric Charts and Charting in Excel 1 April 10th 06 12:57 PM
How to reference in sheet module value on another sheet? Gregg[_4_] Excel Programming 5 May 11th 05 12:05 AM
2 questions, copying data from sheet to sheet and assigning macro Boris Excel Worksheet Functions 0 December 16th 04 06:11 PM


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