Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Copy Range object
Hi,
Without copying (shape of range needs to be identical): Worksheets("Sheet1").Range("A1:B2")=Worksheets ("Sheet2").Range("A1:B2") Regards, Jan Karel Pieterse Excel TA/MVP -----Original Message----- Hi, i'd like to copy one "x" row on worksheet1 to "y" row on worksheet2 or range 1 on worksheet1 to range 2 on worksheet2. Could i copy (assign) one range to another without use copy or copy/pase metod? Thanks Milos . |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Copy Range object
Hi Jan,
yesterday i wrote this sentence: Worksheets("Sheet1").Range("9:9")=Worksheets("Shee t2").Range("15:15") but on worksheet 1 was nothing hapened! Regards, Milos "Jan Karel Pieterse" wrote in message ... Hi, Without copying (shape of range needs to be identical): Worksheets("Sheet1").Range("A1:B2")=Worksheets ("Sheet2").Range("A1:B2") Regards, Jan Karel Pieterse Excel TA/MVP -----Original Message----- Hi, i'd like to copy one "x" row on worksheet1 to "y" row on worksheet2 or range 1 on worksheet1 to range 2 on worksheet2. Could i copy (assign) one range to another without use copy or copy/pase metod? Thanks Milos . |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Copy Range object
I found the same in xl2000, but this worked
Worksheets("Sheet1").Range("9:9").Value= _ Worksheets("Sheet2").Range("15:15").Value -- Regards, Tom Ogilvy "M." wrote in message ... Hi Jan, yesterday i wrote this sentence: Worksheets("Sheet1").Range("9:9")=Worksheets("Shee t2").Range("15:15") but on worksheet 1 was nothing hapened! Regards, Milos "Jan Karel Pieterse" wrote in message ... Hi, Without copying (shape of range needs to be identical): Worksheets("Sheet1").Range("A1:B2")=Worksheets ("Sheet2").Range("A1:B2") Regards, Jan Karel Pieterse Excel TA/MVP -----Original Message----- Hi, i'd like to copy one "x" row on worksheet1 to "y" row on worksheet2 or range 1 on worksheet1 to range 2 on worksheet2. Could i copy (assign) one range to another without use copy or copy/pase metod? Thanks Milos . |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Copy Range object
You said you didn't want to do use copy or copy/paste - that is the easiest
way to copy formatting - what I showed just copyies values (even if the source had formulas). You would have to loop through your cells and specify what attributes you wanted to transfer to do it without using the clipboard. for each cell in Worksheets("Sheet2").Range("15:15") With worksheets("Sheet1").Cells(9,cell.column) .Font.Name = cell.font.name .Font.Size = cell.Font.size .Font.Bold = cell.font.bold .Font.colorIndex = cell.font.ColorIndex .Interior.colorIndex = cell.Interior.ColorIndex .Formula = cell.Formula ' or .Value = cell.Value ' and so forth for whatever attributes you want copies End With Next -- Regards, Tom Ogilvy "M." wrote in message ... Hello Tom, i'm waiting for your explaination but ... Worksheets("Sheet1").Range("9:9").Value= _ Worksheets("Sheet2").Range("15:15").Value that's righ but in this manoeuvre you lost formating from first sheet! Regards, Milos "Tom Ogilvy" wrote in message ... I found the same in xl2000, but this worked Worksheets("Sheet1").Range("9:9").Value= _ Worksheets("Sheet2").Range("15:15").Value -- Regards, Tom Ogilvy "M." wrote in message ... Hi Jan, yesterday i wrote this sentence: Worksheets("Sheet1").Range("9:9")=Worksheets("Shee t2").Range("15:15") but on worksheet 1 was nothing hapened! Regards, Milos "Jan Karel Pieterse" wrote in message ... Hi, Without copying (shape of range needs to be identical): Worksheets("Sheet1").Range("A1:B2")=Worksheets ("Sheet2").Range("A1:B2") Regards, Jan Karel Pieterse Excel TA/MVP -----Original Message----- Hi, i'd like to copy one "x" row on worksheet1 to "y" row on worksheet2 or range 1 on worksheet1 to range 2 on worksheet2. Could i copy (assign) one range to another without use copy or copy/pase metod? Thanks Milos . |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
Copy Range object
Tom, that's good.
In meantime i was used copy and destination O.K., that's work fine, ... and i was adjusted code to work with this metod and propertis, but in the future i would use your example of coping ranges. Thank's! Milos "Tom Ogilvy" wrote in message ... You said you didn't want to do use copy or copy/paste - that is the easiest way to copy formatting - what I showed just copyies values (even if the source had formulas). You would have to loop through your cells and specify what attributes you wanted to transfer to do it without using the clipboard. for each cell in Worksheets("Sheet2").Range("15:15") With worksheets("Sheet1").Cells(9,cell.column) .Font.Name = cell.font.name .Font.Size = cell.Font.size .Font.Bold = cell.font.bold .Font.colorIndex = cell.font.ColorIndex .Interior.colorIndex = cell.Interior.ColorIndex .Formula = cell.Formula ' or .Value = cell.Value ' and so forth for whatever attributes you want copies End With Next -- Regards, Tom Ogilvy "M." wrote in message ... Hello Tom, i'm waiting for your explaination but ... Worksheets("Sheet1").Range("9:9").Value= _ Worksheets("Sheet2").Range("15:15").Value that's righ but in this manoeuvre you lost formating from first sheet! Regards, Milos "Tom Ogilvy" wrote in message ... I found the same in xl2000, but this worked Worksheets("Sheet1").Range("9:9").Value= _ Worksheets("Sheet2").Range("15:15").Value -- Regards, Tom Ogilvy "M." wrote in message ... Hi Jan, yesterday i wrote this sentence: Worksheets("Sheet1").Range("9:9")=Worksheets("Shee t2").Range("15:15") but on worksheet 1 was nothing hapened! Regards, Milos "Jan Karel Pieterse" wrote in message ... Hi, Without copying (shape of range needs to be identical): Worksheets("Sheet1").Range("A1:B2")=Worksheets ("Sheet2").Range("A1:B2") Regards, Jan Karel Pieterse Excel TA/MVP -----Original Message----- Hi, i'd like to copy one "x" row on worksheet1 to "y" row on worksheet2 or range 1 on worksheet1 to range 2 on worksheet2. Could i copy (assign) one range to another without use copy or copy/pase metod? Thanks Milos . |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Working with the range object | Excel Discussion (Misc queries) | |||
Excel Addin:Setting the range to the Excel.Range object range prop | Excel Worksheet Functions | |||
Range object to Array object conversion | Excel Programming | |||
Range object to Array object conversion | Excel Programming | |||
Range object to Array object conversion | Excel Programming |