View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Cimjet[_4_] Cimjet[_4_] is offline
external usenet poster
 
Posts: 29
Default Where am I going wrong? Cells reference to a range appears tohave stopped working!

Hi Mark
I'm no VBA expert and I'm using XL2003 but your script is okay. Close that workbook.
Open a new Workbook and try it again.
Sub test() ' This should select the range(array)
Dim MyVar As Variant
MyVar = ActiveWorkbook.Sheets(1).Range(Cells(1, 1), Cells(27, 11)).Select
End Sub
or
Sub test()
Dim MyVar As Variant ' This will copy your array
MyVar = ActiveWorkbook.Sheets(1).Range(Cells(1, 1), Cells(27, 11))
Range("M1:W27") = MyVar
End Sub

I never copied this way before !!! but it works.
The problem could be what you are trying to do with the variable.
It's Easter Sunday morning and I'm leaving but I'm sure someone else will be able to help if you don't find the problem first.
You've got one wheel stock in the mud and going in circle.
Close everything and clear your mind.
It does wonders
Happy Easter
John