Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Assigning an array to range object?

Hi,

This seems like a silly question but I cant seem to find the answer€¦

In VBA I can do this
Dim wks As Worksheet
Dim rng As Range

Set wks = ThisWorkbook.ActiveSheet
Set rng = wks.Range("A1").Resize(1, 5)
rng = Array("One", "Two", "Three", "Four", "Five")

How do I do the same in VB.NET (2005)?

Thank you,

~Smitch

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 812
Default Assigning an array to range object?

http://www.vb-helper.com/howto_net_declare_arrays.html

Hth,
Merjet


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Assigning an array to range object?

Thank you for the response€¦ I should rephrase my question:

When in VB.NET using the Interop libraries how do you get the
Range = Array assignment to work.

I always get an cast exception. I have tried straight array as well as
object array.

Thank you,
~Smitch


"merjet" wrote:

http://www.vb-helper.com/howto_net_declare_arrays.html

Hth,
Merjet



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
assigning array back to range Jane Excel Programming 1 November 11th 04 07:45 AM
Assigning Range to Array Stratuser Excel Programming 3 October 30th 04 01:50 AM
Assigning range to array not working Marston Excel Programming 2 August 12th 04 11:38 PM
Assigning array to range inside Excel Object Jon Peltier Excel Programming 0 April 1st 04 11:14 PM
Selecting cells which do not meet a formatting criteria, and assigning a Range object to these. SuperJas Excel Programming 5 February 23rd 04 03:36 AM


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