Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 535
Default 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   Report Post  
Posted to microsoft.public.excel.programming
M. M. is offline
external usenet poster
 
Posts: 18
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default 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   Report Post  
Posted to microsoft.public.excel.programming
M. M. is offline
external usenet poster
 
Posts: 18
Default 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
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
Working with the range object [email protected] Excel Discussion (Misc queries) 1 November 26th 07 04:29 PM
Excel Addin:Setting the range to the Excel.Range object range prop Rp007 Excel Worksheet Functions 5 November 24th 06 04:30 PM
Range object to Array object conversion Myrna Larson[_2_] Excel Programming 1 August 1st 03 02:27 AM
Range object to Array object conversion Alan Beban[_3_] Excel Programming 0 August 1st 03 01:24 AM
Range object to Array object conversion Tom Ogilvy Excel Programming 0 August 1st 03 12:16 AM


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