Trying to find a quick and dirty way to initialize an array to 0 values. Using arrays and the Redim statement does the trick but for learning sake I tried to do this with the resize method on ranges which doesn't work. Assume cells A1,B1,A2 and B2 have non-zero values. Here is the code.
Sub test()
Dim rgn As Range
Set rgn = Range("A1:B2")
rgn.Resize(3, 2).Select 'This does select the larger range of 3 rows and 2 columns
rgn.Value = 0 'This only sets the cells A1,B1,A2,B2 to zero but not A3 and B3. Why?
End Sub
Thanks.
Bookmarks