Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
Rob Rob is offline
external usenet poster
 
Posts: 234
Default Errors when using range names in VBA

Hi,

I have a dynamic range name set as MyProd, I used
=OFFSET((sheet1!$B$5,0,0,count(sheet1!$B:$B),5) in the Names menu to define
this. However, since setting this up, the Macro I had that looked up data
in a column from the range MyProd, returns errors as if the range address
isn't known. Is there as solution to resolve this eg. somehow define the
address before running the macro?

Hoping someone can give some direction.

Thanks, Rob


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,593
Default Errors when using range names in VBA

Are you sure that it is not that column B has no numbers?

--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)

"Rob" wrote in message
...
Hi,

I have a dynamic range name set as MyProd, I used
=OFFSET((sheet1!$B$5,0,0,count(sheet1!$B:$B),5) in the Names menu to
define this. However, since setting this up, the Macro I had that looked
up data in a column from the range MyProd, returns errors as if the range
address isn't known. Is there as solution to resolve this eg. somehow
define the address before running the macro?

Hoping someone can give some direction.

Thanks, Rob



  #3   Report Post  
Posted to microsoft.public.excel.programming
Rob Rob is offline
external usenet poster
 
Posts: 234
Default Errors when using range names in VBA

Bob,

Have checked data and its all there when looking at the range name. It also
works when I simply just name the range.

Regards, Rob
"Bob Phillips" wrote in message
...
Are you sure that it is not that column B has no numbers?

--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my
addy)

"Rob" wrote in message
...
Hi,

I have a dynamic range name set as MyProd, I used
=OFFSET((sheet1!$B$5,0,0,count(sheet1!$B:$B),5) in the Names menu to
define this. However, since setting this up, the Macro I had that looked
up data in a column from the range MyProd, returns errors as if the range
address isn't known. Is there as solution to resolve this eg. somehow
define the address before running the macro?

Hoping someone can give some direction.

Thanks, Rob





  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,494
Default Errors when using range names in VBA

if i enter data into enter data into b5:b25

then i fix your formula:
=OFFSET(sheet1!$B$5,0,0,count(sheet1!$B:$B),5)

and then type this in the immedidate window:
?range("myprod").Address

it returns:
$B$5:$F$25


--


Gary


"Rob" wrote in message
...
Hi,

I have a dynamic range name set as MyProd, I used
=OFFSET((sheet1!$B$5,0,0,count(sheet1!$B:$B),5) in the Names menu to define
this. However, since setting this up, the Macro I had that looked up data in
a column from the range MyProd, returns errors as if the range address isn't
known. Is there as solution to resolve this eg. somehow define the address
before running the macro?

Hoping someone can give some direction.

Thanks, Rob



  #5   Report Post  
Posted to microsoft.public.excel.programming
Rob Rob is offline
external usenet poster
 
Posts: 234
Default Errors when using range names in VBA

Thanks everyone, seem to have cracked it with $ sign, had $B5 and not $B$5.

Thanks, Rob

"Gary Keramidas" <GKeramidasATmsn.com wrote in message
...
if i enter data into enter data into b5:b25

then i fix your formula:
=OFFSET(sheet1!$B$5,0,0,count(sheet1!$B:$B),5)

and then type this in the immedidate window:
?range("myprod").Address

it returns:
$B$5:$F$25


--


Gary


"Rob" wrote in message
...
Hi,

I have a dynamic range name set as MyProd, I used
=OFFSET((sheet1!$B$5,0,0,count(sheet1!$B:$B),5) in the Names menu to
define this. However, since setting this up, the Macro I had that looked
up data in a column from the range MyProd, returns errors as if the range
address isn't known. Is there as solution to resolve this eg. somehow
define the address before running the macro?

Hoping someone can give some direction.

Thanks, Rob





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
converting email address names in a range of cells to real names John Excel Worksheet Functions 1 May 19th 10 03:44 PM
COPYING FORMULA CONTAINING NAMES/RELATIVE RANGE NAMES Bricol Excel Discussion (Misc queries) 0 July 8th 08 03:54 PM
SumProduct When Range Has Errors carl Excel Worksheet Functions 1 August 23rd 07 04:22 PM
Deleting names with errors Jack Sheet Excel Programming 5 December 2nd 04 12:49 PM


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