LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 14
Default range property of range object

I'm working on app where I have to copy data between several books/sheets,
and it's a pain to make sure i'm referencing the correct
source/destination.

I try to set object references to each of the books/sheets I'm working with
and use those to preface the copy/pastes.

While doing that I noticed that the range object has a range property, and
I wanted to know how to use it.

For instance:

Set rngTestRange = oSheet.Cells(6, 1)
Do
Set rngTestRange = rngTestRange.Offset(1, 0)

'check for start of new cost account
If Not IsEmpty(rngTestRange.Value) Then
sAccount = rngTestRange

For x = 1 To oChartSkel.Sheets.Count
'copy chart sheets from skel to this cam's chart notebook
oChartSkel.Sheets(x).Copy After:=oThisMgrChartBook.Sheets(1)
Set oCurrentChartSheet = ActiveSheet
oCurrentChartSheet.Name = sAccount & oChartSkel.Sheets(x).Name

'copy from source to this chart's data
oSheet.Range(Cells(rngTestRange.Row + 1, 4), Cells
(rngTestRange.Row + 16, 21)).Copy
oCurrentChartSheet.Range("B52").PasteSpecial xlPasteValues
Next x

End If

Loop Until rngTestRange.Row = lngLastRow

Instead of

oSheet.Range(Cells(rngTestRange.Row + 1, 4), Cells(rngTestRange.Row + 16,
21)).Copy

Could I have used:

rngTestRange.Range(Cells(rngTestRange.Row + 1, 4), Cells(rngTestRange.Row +
16, 21)).Copy

is the range property from a sheet the same as the range property from a
range?

Thanks,
Woody
 
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
Excel Addin:Setting the range to the Excel.Range object range prop Rp007 Excel Worksheet Functions 5 November 24th 06 04:30 PM
Range Question / error 1004: method Range of object Worksheet has failed Paul Excel Programming 3 April 7th 05 02:56 PM
How to use Cells property to Range object? deko[_2_] Excel Programming 4 March 8th 05 07:17 PM
using RANGE object in multiple-area range TerryT Excel Programming 3 December 8th 04 09:13 PM
Adding named range gives error "method range of object _Global failed " Gunnar Johansson Excel Programming 3 August 10th 04 01:54 PM


All times are GMT +1. The time now is 01:32 PM.

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

About Us

"It's about Microsoft Excel"