LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 124
Default Where am I going wrong? Cells reference to a range appears to havestopped working!

Hi,

This one is really puzzling me as it seems pretty basic but obviously (unless VBA in excel 2013 has stopped supporting it which is unlikely) I am doing something wrong.

I am actually trying to assign a range to an array like so:

Dim MyVar as variant
MyVar = ActiveWorkbook.Sheets(1).Range(Cells(1, 1), Cells(27, 11))

For some strange reason it will not do the allocation.

I thought that maybe I had gotten the reference notation wrong so I tried the following to test it:

ActiveWorkbook.Sheets(1).Range(Cells(1, 1), Cells(27, 11)).Select

Lo and behold that wont work either, which suggests that's the problem.

However I have looked up the notation to check, and even pasted an example from Microsoft into my code to test and that wont work either, which suggests it may be something else but I am at a complete loss to know what that something else might be. Can anyone either see anything wrong with the code above or if not suggest what is wrong/why it isn't working?

Any help much appreciated, it's almost embarrassing to be asking such a simple thing but I've tried everything I can to fix it and it has held me up for long enough so I thought someone on the user group may be able to help me.

Thanks in advance, Mark
 
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
What's wrong: Only one address block appears per page CarolRy Excel Discussion (Misc queries) 2 July 28th 09 04:06 PM
VBA to reference one cell in a range of one or more cells Bernie Deitrick Excel Programming 0 February 29th 08 11:12 PM
reference format Range(Cells(),Cells()) Stefi Excel Programming 5 December 16th 05 02:25 PM
How do I reference the same cell as I move through range of cells. MikeShep Excel Worksheet Functions 1 February 7th 05 12:12 PM
the autosum do not working propely ##### THAT WHAT APPEARS PLEA. excel Excel Discussion (Misc queries) 1 January 21st 05 02:59 PM


All times are GMT +1. The time now is 07:22 PM.

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"