A Microsoft Excel forum. ExcelBanter

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » ExcelBanter forum » Excel Newsgroups » Excel Programming
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

Array to specific worksheet - nothing seems to work



 
 
Thread Tools Display Modes
  #1  
Old June 3rd 12, 06:29 PM posted to microsoft.public.excel.programming
dial13[_2_]
external usenet poster
 
Posts: 6
Default Array to specific worksheet - nothing seems to work

I have tried everything but the array stubbornly refuses to populate
any sheet except the one the code belongs to:

Sub WontChangeWorksheetDestination()

Dim wks As Worksheet
Set wks = Sheets(3)

With wks

Set TheRange = Range(Cells(1, 1), Cells(10, 10))
TheRange.Value = MyArray

End With

End sub

I've tried everything, but because the code is behind a button on
sheet 1 the array populates sheet 1 and doesn't seem to want to
populate any toher sheet no mattwer hw I try to qualify it ... what am
I missing?

Any help gratefully accepted,

Kind regards, Mark
Ads
  #2  
Old June 4th 12, 02:11 AM posted to microsoft.public.excel.programming
isabelle
external usenet poster
 
Posts: 450
Default Array to specific worksheet - nothing seems to work

hi dial13,

you missed the point ;-)

replace
Set TheRange = Range(Cells(1, 1), Cells(10, 10))

by
Set TheRange = .Range(.Cells(1, 1), .Cells(10, 10))


--
isabelle



Le 2012-06-03 13:29, dial13 a écrit :
> Sub WontChangeWorksheetDestination()
>
> Dim wks As Worksheet
> Set wks = Sheets(3)
>
> With wks
>
> Set TheRange = Range(Cells(1, 1), Cells(10, 10))
> TheRange.Value = MyArray
>
> End With
>
> End sub

  #3  
Old June 4th 12, 02:23 AM posted to microsoft.public.excel.programming
dial13[_2_]
external usenet poster
 
Posts: 6
Default Array to specific worksheet - nothing seems to work

Hahaha thanks a lot, works like a dream



On Monday, June 4, 2012 9:11:40 AM UTC+8, isabelle wrote:
> hi dial13,
>
> you missed the point ;-)
>
> replace
> Set TheRange = Range(Cells(1, 1), Cells(10, 10))
>
> by
> Set TheRange = .Range(.Cells(1, 1), .Cells(10, 10))
>
>
> --
> isabelle
>
>
>
> Le 2012-06-03 13:29, dial13 a écrit :
> > Sub WontChangeWorksheetDestination()
> >
> > Dim wks As Worksheet
> > Set wks = Sheets(3)
> >
> > With wks
> >
> > Set TheRange = Range(Cells(1, 1), Cells(10, 10))
> > TheRange.Value = MyArray
> >
> > End With
> >
> > End sub


 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Array to specific worksheet - nothing seems to work dial13[_2_] Excel Programming 2 June 4th 12 02:24 AM
Find specific value in array of array formula DzednConfsd Excel Worksheet Functions 2 January 13th 09 06:19 AM
select range of specific hidden worksheet of closed protected work JASelep Excel Programming 0 September 6th 07 01:56 PM
Navigate to specific cell on specific worksheet Bryan Excel Programming 2 April 13th 06 04:33 PM
Select an array of cells and paste to separate worksheet - 2nd post - 1st didn't work!! Lee Wold[_2_] Excel Programming 1 February 10th 04 03:22 PM


All times are GMT +1. The time now is 09:19 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Copyright ©2004-2013 ExcelBanter.
The comments are property of their posters.