Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Type Mismatch!!! | Excel Programming | |||
Type Mismatch: array or user defined type expected | Excel Programming | |||
Type mismatch using rnge as Range with Type 8 Input Box | Excel Programming | |||
Help: Compile error: type mismatch: array or user defined type expected | Excel Programming | |||
Type mismatch | Excel Programming |