Array to specific worksheet - nothing seems to work

D

dial13

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
 
C

Claus Busch

Hi,

Am Sun, 3 Jun 2012 10:29:01 -0700 (PDT) schrieb dial13:
With wks

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

End With

try:

With wks
Set TheRange = .Range(.Cells(1, 1), .Cells(10, 10))
TheRange.Value = MyArr
End With


Regards
Claus Busch
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top