Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 469
Default copy certain cells

I wish to copy only the listed cells Range does not like my way of saying
this. Range target offset is the area I am having problem. Is it poss to only
copie the listed cells? This procedure is called from action on another
sheet. The cells to copy are on that sheet. they are column(A_D_E_F_H_M) M is
trigger cell on sheet.
Thanks to all we sure do get ourselves into things.
Thanks

Public Sub CopyDoIt(ByVal Target As Range)
Dim wksSummary As Worksheet
Dim rngPaste As Range
Set wksSummary = Sheets("Announcer")
Set rngPaste = wksSummary.Cells(65536, "A").End(xlUp).Offset(1, 0)
Application.EnableEvents = False
Set rngPaste = rngPaste.Offset(0, 0)

Range(Target.Offset(0, -12), Target.Offset(0, 0), (-1), (4), (5), (8),
(13)).Copy _

Destination:=rngPaste
rngPaste.Offset(0, 6) = Target
Application.EnableEvents = True
End Sub
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,510
Default copy certain cells

Hi Curt,

Have a look at the example. I simply dummied up some info but I think that
it might explain enough for you to achieve your goal.

Sub Test_Multi_Rnge_Copy()

Dim targDummy As Range
Dim rngPaste As Range
Dim myMultipleRange As Range

Set targDummy = Range("N3")
Set rngPaste = Range("N1")
Range("A1").Select

Set myMultipleRange = _
Union(targDummy.Offset(0, -12), _
targDummy.Offset(0, 0), _
targDummy.Offset(0, -1), _
targDummy.Offset(0, 4), _
targDummy.Offset(0, 5), _
targDummy.Offset(0, 8), _
targDummy.Offset(0, 13))

myMultipleRange.Copy Destination:=rngPaste

End Sub


Hope it helps.

Regards,

OssieMac


"Curt" wrote:

I wish to copy only the listed cells Range does not like my way of saying
this. Range target offset is the area I am having problem. Is it poss to only
copie the listed cells? This procedure is called from action on another
sheet. The cells to copy are on that sheet. they are column(A_D_E_F_H_M) M is
trigger cell on sheet.
Thanks to all we sure do get ourselves into things.
Thanks

Public Sub CopyDoIt(ByVal Target As Range)
Dim wksSummary As Worksheet
Dim rngPaste As Range
Set wksSummary = Sheets("Announcer")
Set rngPaste = wksSummary.Cells(65536, "A").End(xlUp).Offset(1, 0)
Application.EnableEvents = False
Set rngPaste = rngPaste.Offset(0, 0)

Range(Target.Offset(0, -12), Target.Offset(0, 0), (-1), (4), (5), (8),
(13)).Copy _

Destination:=rngPaste
rngPaste.Offset(0, 6) = Target
Application.EnableEvents = True
End Sub

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 can I copy big ranges of cells without drag or copy/paste? Ricardo Julio Excel Discussion (Misc queries) 3 March 23rd 10 02:38 PM
Copy and paste versus copy and insert copied cells Alana New Users to Excel 1 September 28th 07 08:58 PM
Copy/Paste how to avoid the copy of formula cells w/o calc values Dennis Excel Discussion (Misc queries) 10 March 2nd 06 10:47 PM
How to use macros to copy a range of cells which can exclude some cells which I didn't want to be copied? excelnovice Excel Worksheet Functions 2 September 25th 05 12:38 AM
Copy data into cells until changes trigger new copy mdeanda Excel Programming 2 April 25th 05 01:32 PM


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