Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 220
Default Simple Row Offset Question

I'm using this simple code to copy and paste values from one sheet to
another but for some reason I can't figure out how to move the
DestRange1 down one row. I'm pretty sure it's Offset but I can't
figure out where to put it...

LC1 = Lastcol(WB2.Sheets(2)) + 1

Set SourceRange = WB1.Columns("A:D").Columns("F:K")
Set DestRange1 = WB2.Sheets(2).Columns(LC1)

SourceRange.Copy DestRange1

Thanks,
-- Dan

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default Simple Row Offset Question

since you are copying a whole column, you can't move the destination range
down one row.

as an example,

columns(1).Offset(1,0) won't work
--
Regards,
Tom Ogilvy



"Dan R." wrote:

I'm using this simple code to copy and paste values from one sheet to
another but for some reason I can't figure out how to move the
DestRange1 down one row. I'm pretty sure it's Offset but I can't
figure out where to put it...

LC1 = Lastcol(WB2.Sheets(2)) + 1

Set SourceRange = WB1.Columns("A:D").Columns("F:K")
Set DestRange1 = WB2.Sheets(2).Columns(LC1)

SourceRange.Copy DestRange1

Thanks,
-- Dan


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 220
Default Simple Row Offset Question

On Jan 30, 3:17 pm, Tom Ogilvy
wrote:
since you are copying a whole column, you can't move the destination range
down one row.

as an example,

columns(1).Offset(1,0) won't work
--
Regards,
Tom Ogilvy



"Dan R." wrote:
I'm using this simple code to copy and paste values from one sheet to
another but for some reason I can't figure out how to move the
DestRange1 down one row. I'm pretty sure it's Offset but I can't
figure out where to put it...


LC1 = Lastcol(WB2.Sheets(2)) + 1


Set SourceRange = WB1.Columns("A:D").Columns("F:K")
Set DestRange1 = WB2.Sheets(2).Columns(LC1)


SourceRange.Copy DestRange1


Thanks,
-- Dan- Hide quoted text -


- Show quoted text -


Tom, I just realized that this also isnt the correct way to copy
multiple ranges, if I wanted to copy and paste ranges "A:D" and "F:K"
what would be the proper way to do this?

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 220
Default Simple Row Offset Question

On Jan 30, 3:33 pm, "Dan R." wrote:
On Jan 30, 3:17 pm, Tom Ogilvy
wrote:





since you are copying a whole column, you can't move the destination range
down one row.


as an example,


columns(1).Offset(1,0) won't work
--
Regards,
Tom Ogilvy


"Dan R." wrote:
I'm using this simple code to copy and paste values from one sheet to
another but for some reason I can't figure out how to move the
DestRange1 down one row. I'm pretty sure it's Offset but I can't
figure out where to put it...


LC1 = Lastcol(WB2.Sheets(2)) + 1


Set SourceRange = WB1.Columns("A:D").Columns("F:K")
Set DestRange1 = WB2.Sheets(2).Columns(LC1)


SourceRange.Copy DestRange1


Thanks,
-- Dan- Hide quoted text -


- Show quoted text -


Tom, I just realized that this also isnt the correct way to copy
multiple ranges, if I wanted to copy and paste ranges "A:D" and "F:K"
what would be the proper way to do this?- Hide quoted text -

- Show quoted text -


Nevermind Tom, it's easier just to delete column E after I paste it.

Thanks,
-- Dan

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Simple Row Offset Question

Just for completeness:

Range("A:D,F:K").copy

--
Regards,
Tom Ogilvy



"Dan R." wrote in message
ups.com...
On Jan 30, 3:33 pm, "Dan R." wrote:
On Jan 30, 3:17 pm, Tom Ogilvy
wrote:





since you are copying a whole column, you can't move the destination
range
down one row.


as an example,


columns(1).Offset(1,0) won't work
--
Regards,
Tom Ogilvy


"Dan R." wrote:
I'm using this simple code to copy and paste values from one sheet to
another but for some reason I can't figure out how to move the
DestRange1 down one row. I'm pretty sure it's Offset but I can't
figure out where to put it...


LC1 = Lastcol(WB2.Sheets(2)) + 1


Set SourceRange = WB1.Columns("A:D").Columns("F:K")
Set DestRange1 = WB2.Sheets(2).Columns(LC1)


SourceRange.Copy DestRange1


Thanks,
-- Dan- Hide quoted text -


- Show quoted text -


Tom, I just realized that this also isnt the correct way to copy
multiple ranges, if I wanted to copy and paste ranges "A:D" and "F:K"
what would be the proper way to do this?- Hide quoted text -

- Show quoted text -


Nevermind Tom, it's easier just to delete column E after I paste it.

Thanks,
-- Dan



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
simple formula I'm sure using offset? or index? Steve Excel Discussion (Misc queries) 2 December 3rd 09 05:23 PM
IF formula-simple question; simple operator Rich D Excel Discussion (Misc queries) 4 December 6th 07 03:36 PM
Simple Simple Excel usage question BookerW Excel Discussion (Misc queries) 1 June 23rd 05 10:06 PM
Simple one? How to shade an offset cell... Kevin Excel Programming 2 May 18th 04 01:31 PM
Need help - how to shade an offset cell....(simple?) Kevin Excel Programming 2 May 18th 04 01:30 PM


All times are GMT +1. The time now is 03:02 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"