PC Review


Reply
Thread Tools Rate Thread

copy certain cells

 
 
=?Utf-8?B?Q3VydA==?=
Guest
Posts: n/a
 
      22nd Aug 2007
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 With Quote
 
 
 
 
=?Utf-8?B?T3NzaWVNYWM=?=
Guest
Posts: n/a
 
      22nd Aug 2007
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 With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
copy an intial cells contents into the next series of blank cells ina column freeriderxlt Microsoft Excel Discussion 2 25th Aug 2009 07:47 AM
RE: Copy Visible Cells in Sheet with Merged and Hidden Cells FSt1 Microsoft Excel Misc 1 2nd Oct 2008 12:51 AM
macro needed to copy blocks of cells across to list of cells down =?Utf-8?B?cGllcnNvbnBybw==?= Microsoft Excel Programming 3 28th Mar 2007 12:51 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 Microsoft Excel Worksheet Functions 2 25th Sep 2005 12:38 AM
How to COPY from cells to cells w/o affecting respective formulae underneath ? EduardoDon Microsoft Excel New Users 1 21st Apr 2004 12:12 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 05:19 AM.