473,395 Members | 1,641 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Setting a range object

1
Hi all,

i have been assigned a project where i need a little help from VB. My question is related to declaring range variables:
Q:
"Is i it possible in VB to declare a range variable that can store different range sets ( which again are functions of row & col) for different values of i & j. I want something like:
For i 1 to 5
For j = 1 to 5
Set Range (i, j) = range ((cells (1,1) to Cells (i,j))

next i
next j

If above is not possible could anyone please suggest me any alternative

thanks.
-Nitesh
Jul 1 '06 #1
1 5286
BSOB
77
your question is somewhat old so i dont know if you have found a fix and im not exactly sure what you want.
from what i can tell you need to define your own "type" of variable.
type rangetype
Xinitial as integer
Xfinal as integer
Yinital as integer
YFinal as integer
end type

... and then ...
dim Range(25,25) as rangetype
... and then ...
set range(i,j).xinitial = 1
set range(i,j).yinitial = 1
set range(i,j).xfinal = i
set range(i,j).yfinal = j
Jul 19 '06 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

6
by: rzed | last post by:
I'm using PIL to generate some images which may be rotated at the user's option. When they are rotated, the original image is cropped in the new image (which is fine), and the corners are black...
0
by: Rick | last post by:
I've seen postings before showing users how to set the range but I'm still not able to get it working locally. I have a report with one range and nothing else, it's a date range, I need to set...
0
by: Emmanuel | last post by:
Hi, I 've managed to run successfully the example provided by the Microsoft Q302901 - "How To Build an Office COM Add-in by Using Visual C# .NET" article...
4
by: IMS.Rushikesh | last post by:
Hi All, I am trying to execute below code but it gives me an COMException ///// Code Start //// public string GetName(Excel.Range range) { try { if (range.Name != null)
0
by: James Wallace | last post by:
I would like to know if anyone knows how to apply a date range to a range value parameter of a crystal report without using the cystal report viewer. Currently I have to pass a range value to a...
0
by: ns2k | last post by:
I tried to implements Microsoft.Office.Core.Range Interface, but the dot net raise errors : + ' '_Default' cannot implement '_Default' because there is no matching property on interface 'Range'.'...
1
by: laredotornado | last post by:
Hi, I'm using PHP 4.4.4 on Apache 2 on Fedora Core 5. PHP was installed using Apache's apxs and the php library was installed to /usr/local/php. However, when I set my "error_reporting"...
9
by: Doug Glancy | last post by:
I got the following code from Francesco Balena's site, for disposing of Com objects: Sub SetNothing(Of T)(ByRef obj As T) ' Dispose of the object if possible If obj IsNot Nothing AndAlso...
27
by: geniet | last post by:
Hello all of you, I have some problem in setting cells values (or fromat or...) in my Excel spreadsheet using a VB statement like within my Module: Range("C1").Value = 20 I have this in a...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.