Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 94
Default Question about range values with Set =

I'm having a problem trying to get Set = to allow a split range.

I'll explain. I have a custom function that allows you to get data from
another Workbook, one of the lines of code is this...

Set r = xlwb.Sheets(1).Range(Mid(xref, n + 1))

r is a Range variable. this is my problem variable.
xlwb is a Workbook variable that has already been set and is working fine.
xref is a string which contains (among other things) the range we want.
n is a variable which denotes where to find the range in xref. Again this is
fine.

I get a problem when I the Range(Mid(xref, n + 1)) evaluates to this...

Range(("A1:A10, C1:C10"))

I'm not sure if the syntax is wrong as I'm using the Set command or what.

Any help would be gratefully received.

TIA.

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 789
Default Question about range values with Set =

Hi
What is the problem? An error message or no error message but something
you don't expect.
If it is an error message, the prblem may not be with this line of
code, even though the VBE says it is. So people need to see the code.
If it is something you don't expect, say what you do expect ansd say
what you get. Again, people may need to see your code.
regards
Paul

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 94
Default Question about range values with Set =

The problem is that is does not select the second range. In my example, only
the A1:A10 would be brought over and not the C1:C10. No error messages, it
just doesn;t seem to pick up the 2 ranges.

I will include all of the code if you wish, however it is quite long and I'm
not sure if it will add much value.

TIA.

" wrote:

Hi
What is the problem? An error message or no error message but something
you don't expect.
If it is an error message, the prblem may not be with this line of
code, even though the VBE says it is. So people need to see the code.
If it is something you don't expect, say what you do expect ansd say
what you get. Again, people may need to see your code.
regards
Paul


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
calculate values in an unlimited range of cells in a column WITHOUTalso calculating values that had previously been filtered AGAINST? yadang Excel Discussion (Misc queries) 2 October 1st 09 06:18 PM
SUMPRODUCT or SUMIF if any values in a range equal any values in another range PCLIVE Excel Worksheet Functions 3 July 15th 09 07:43 PM
formula for range values question webadict2be Excel Discussion (Misc queries) 4 February 7th 06 12:49 AM
Search/Filter to find values in another range based on two cell values Andy Excel Programming 2 April 29th 04 04:08 PM
Question about sorting and "key" range values TBA[_2_] Excel Programming 3 September 25th 03 02:01 PM


All times are GMT +1. The time now is 12:28 AM.

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"