Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default Histogram Invalid Reference

R1C1 isn't supported as an addressing scheme in VBA.

Not sure what is wrong with Cells(row,column)

--
Regards,
Tom Ogilvy


" wrote:

Tom,

Thanks. That reference was already set and there was also a
ATPBVAEN.XLS listed that I referenced. That didn't help...and I
thought it odd to have an XLS extension since the toolpak was an add-
in.

I understand your comment about the range reference. SourceData is
the activesheet since the cells reference works. I'm an engineer and
think better in a numbered gird (R1C1 reference). How can on make
reference using the (r,c) notation on anything but the activesheet?
In other words, how can I use (r,c) without also using cells(r,c)?

Thanks,
John



On Jul 28, 10:40 pm, Tom Ogilvy
wrote:
in the vbe, Tools=References, select the analysis toolpak.

That would allow you to call Histogram like it was a built in function, but
since you are using application.Run, you shouldn't need a reference.

this kind of reference:
SourceData.Range(Cells(StartRow, 2),Cells(EndRow - 1, 2))

is inconsistent.

If in a general module:
If SourceData is the activesheet, it works, but then there is no reason to
have the qualifier SourceData. If SourceData isn't the activesheet, then
Range refers to the sourcedata sheet and Cells refers the activesheet and
raises an error.

With SourceData
Set HistData = .Range(.Cells(StartRow, 2),.Cells(EndRow - 1, 2))
End with

Would be consistent and avoid errors. There is a similar type problem if
the code is in a worksheet module in that the unqualified references refer to
the sheet that contain the code.

--
Regards,
Tom Ogilvy



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
invalid reference for vlookup Ed Hoag Excel Worksheet Functions 2 May 14th 23 11:43 AM
Invalid cell reference Grey Old Man[_2_] Excel Discussion (Misc queries) 1 April 26th 10 02:47 PM
excel invalid reference juanita Excel Discussion (Misc queries) 0 September 18th 09 06:09 PM
How do I fix an Invalid Reference? Nic New Users to Excel 1 June 1st 06 04:43 PM
Another invalid or unqualified reference davegb Excel Programming 24 August 31st 05 06:32 PM


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