Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default Range question

Hi there,
I'd like to seperate a range to n different ranges then
pass these ranges as parameters to a function in Visual
Basic separately.
I use:
Set myRange = Excel.Range(OldRange(1, 1), OldRange(99, 1))
to make a new range "myRange", which has the first 100
value in old range "OldRange"

It works fine in VBA, but in VB it is failed.

Any suggestions? Thanks,

Lee
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 226
Default Range question

Try using

Set myRange = OldRange(1, 1).Resize(100)

--
Regards

Juan Pablo González

"Lee dengo" wrote in message
...
Hi there,
I'd like to seperate a range to n different ranges then
pass these ranges as parameters to a function in Visual
Basic separately.
I use:
Set myRange = Excel.Range(OldRange(1, 1), OldRange(99, 1))
to make a new range "myRange", which has the first 100
value in old range "OldRange"

It works fine in VBA, but in VB it is failed.

Any suggestions? Thanks,

Lee



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 340
Default Range question

use

Set myRange = Excel.Range(Cells(1, 1), Cells(99, 1))

Bob Flanagan
Macro Systems
http://www.add-ins.com
Productivity add-ins and downloadable books on VB macros for Excel


"Lee dengo" wrote in message
...
Hi there,
I'd like to seperate a range to n different ranges then
pass these ranges as parameters to a function in Visual
Basic separately.
I use:
Set myRange = Excel.Range(OldRange(1, 1), OldRange(99, 1))
to make a new range "myRange", which has the first 100
value in old range "OldRange"

It works fine in VBA, but in VB it is failed.

Any suggestions? Thanks,

Lee



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
Range Question N.F[_2_] Excel Discussion (Misc queries) 5 July 28th 07 01:05 AM
Range question in '97 Adam Kroger Excel Discussion (Misc queries) 10 December 12th 05 03:44 AM
Used Range Question a Excel Programming 2 May 26th 04 03:45 AM
Range Question Ray Batig Excel Programming 4 January 31st 04 05:01 AM
Range.Formula and Range question using Excel Automation [email protected] Excel Programming 0 September 19th 03 04:53 AM


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