type mismatch
Tech-Archive recommends: Fix windows errors by optimizing your registry
I am a beginner in programming VBA
I want to write a function that returns an array where each element is
increased by 1.
However, something is not working. Could you please help me?
Function b(r As Range)
Dim i As Integer, j As Integer
b = r
For i = 1 To UBound(b, 1)
For j = 1 To UBound(b, 2)
b(i, j) = b(i, j) + 1
Next j
Next i
End Function
For example,
............A..........B
1.........1...........2
2.........2...........3
3.........3...........4
In this case, B1:B3 contains the formula =b(A1:a3) entered with
Ctrl-Shift-Enter
Thank you
.
Relevant Pages
- Re: argh! more undocumented mysteries: to_yaml
... You cannot use to_yaml for Array, ... Object#to_yaml in Ruby Documentation. ... Beginner woes, here, no doubt, but woes nevertheless. ... (comp.lang.ruby) - Re: date format
... I'm not a beginner and I found this example rather obscure and hard to ... Perl needn't look that much like line noise IMO. ... but the content of that array is not univocal here anyway) ... (comp.lang.perl.misc) - Re: How do I find the number of elements in an Array of Strings?
... > I'm programming VBA in Excel 2003. ... > refer to the elements by their index number, not their value as a string. ... > How can I find the number of elements in an array of strings? ... (microsoft.public.excel.programming) - Re: Using pointers
... I am also a beginner, but will try and give my thoughts also. ... Dynamic memory is a good way to go when you don't know ahead of time how ... It's wastefull to dedicate an array of ... (alt.comp.lang.learn.c-cpp) - Re: Using pointers
... > Dan Moos wrote: ... >> I am also a beginner, but will try and give my thoughts also. ... >> Dynamic memory is a good way to go when you don't know ahead of time how ... >> array or other structure that is big enough to hold the largest number ... (alt.comp.lang.learn.c-cpp) |
|