Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
simple formula I'm sure using offset? or index? | Excel Discussion (Misc queries) | |||
IF formula-simple question; simple operator | Excel Discussion (Misc queries) | |||
Simple Simple Excel usage question | Excel Discussion (Misc queries) | |||
Simple one? How to shade an offset cell... | Excel Programming | |||
Need help - how to shade an offset cell....(simple?) | Excel Programming |