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: 30
Default Referring to ranges as Cell, Range, and variables

I have been experimenting with the whole Cells([whatever, whatever]),
Range(Whatever, whatever), using variables that are ranges, etc., and I
swear every time I think I have figured out how to refer to things, I get
the error about type mismatch. I mean really.

Can anyone tell me how to get this to work:

Worksheets("MySheet").Range("A65536").End(xlUp).Of fset(1, 0).Address ,
("A" & UBound(MyArray) + 1) =
Application.WorksheetFunction.Transpose(MyArray)

This is supposed to find the first blank cell in A, set the range from there
to the number of elements in my array down, then put in my array values. I
can debug.print the 1st address, printing ("A" & UBound(MyArray) + 1) IS
giving me "A9" (there are 8 elements in my array), so that's working, and I
can print the elements in the array. I set a range and filled it EXACTLY
like this before, except for that I was using Range("A1:A" & UBound(MyArray)
+ 1), and that worked perfectly. This seems so slightly different I can't
figure out whay I'd get type mismatch.

As long as I'm talking about it, does anyone know how to paste an array's
values by just selecting the first cell you want? In Excel, if you have
ranges/values in the clipboard, you can click just one cell and paste; is
there a way in vba to just click one cell and transpose your array
successfully, besides looping through every element and offsetting every
time?

Thanks again. I know I'm posting a lot, but believe me, I'm spending hours
on everything I can't quite get. And I found out how to do some great stuff
I never knew about before, but unfortunately none of it applies to what I'm
doing.

 
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
Referring to Range addresses when in variables CompleteNewb[_2_] Excel Programming 2 October 17th 10 11:56 PM
Referring to specific cell in named range in Excel formula Nigel Barton Excel Worksheet Functions 3 August 18th 09 04:25 PM
Referring to a cell by entering an integer; RANGE functions Tim Murray Excel Worksheet Functions 5 May 24th 08 11:21 PM
Referring to first cell in a range FARAZ QURESHI Excel Discussion (Misc queries) 5 December 26th 07 05:14 PM
Cell Variables and Ranges jcottam Excel Discussion (Misc queries) 2 March 31st 06 07:33 PM


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